mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Update test with comments + minor tweak
Signed-off-by: Dan Ryan <dan@danryan.co>
This commit is contained in:
@@ -280,15 +280,16 @@ def test_skip_requirements_when_pipfile(PipenvInstance, pypi):
|
||||
with PipenvInstance(chdir=True, pypi=pypi) as p:
|
||||
with open('requirements.txt', 'w') as f:
|
||||
f.write('requests==2.18.1\n')
|
||||
c = p.pipenv('install six')
|
||||
assert c.return_code == 0
|
||||
with open(p.pipfile_path, 'w') as f:
|
||||
contents = """
|
||||
[packages]
|
||||
six = "*"
|
||||
tablib = "<0.12"
|
||||
""".strip()
|
||||
f.write(contents)
|
||||
c = p.pipenv('install')
|
||||
assert c.return_code == 0
|
||||
c = p.pipenv('install six')
|
||||
assert 'tablib' in p.pipfile['packages']
|
||||
assert 'tablib' in p.lockfile['default']
|
||||
assert 'six' in p.pipfile['packages']
|
||||
@@ -296,6 +297,7 @@ tablib = "<0.12"
|
||||
assert 'requests' not in p.pipfile['packages']
|
||||
assert 'requests' not in p.lockfile['default']
|
||||
|
||||
|
||||
@pytest.mark.cli
|
||||
@pytest.mark.clean
|
||||
def test_clean_on_empty_venv(PipenvInstance, pypi):
|
||||
@@ -306,6 +308,9 @@ def test_clean_on_empty_venv(PipenvInstance, pypi):
|
||||
|
||||
@pytest.mark.install
|
||||
def test_install_does_not_extrapolate_environ(PipenvInstance, pypi):
|
||||
"""This test is deisgned to make sure that pipenv ignores requirements.txt files
|
||||
for projects that already exist (already have a Pipfile) as well as for times when a
|
||||
package name is passed in to the install command."""
|
||||
with temp_environ(), PipenvInstance(pypi=pypi, chdir=True) as p:
|
||||
os.environ['PYPI_URL'] = pypi.url
|
||||
|
||||
@@ -357,29 +362,6 @@ def test_install_venv_project_directory(PipenvInstance, pypi):
|
||||
assert Path(project.virtualenv_location).joinpath('.project').exists()
|
||||
|
||||
|
||||
@pytest.mark.install
|
||||
@pytest.mark.requirements
|
||||
def test_install_ignores_requirements_with_existing_projects(PipenvInstance, pypi):
|
||||
"""This test is deisgned to make sure that pipenv ignores requirements.txt files
|
||||
for projects that already exist (already have a Pipfile) as well as for times when a
|
||||
package name is passed in to the install command."""
|
||||
with PipenvInstance(chdir=True, pypi=pypi) as p:
|
||||
requirements_path = Path(p.path).joinpath('requirements.txt')
|
||||
requirements_path.write_text("""
|
||||
pytz
|
||||
chardet
|
||||
""".strip())
|
||||
p.pipenv('install six')
|
||||
assert 'six' in p.pipfile['packages']
|
||||
assert 'chardet' not in p.pipfile['packages']
|
||||
assert 'pytz' not in p.pipfile['packages']
|
||||
p.pipenv('--rm')
|
||||
p.pipenv('install')
|
||||
assert 'six' in p.pipfile['packages']
|
||||
assert 'chardet' not in p.pipfile['packages']
|
||||
assert 'pytz' not in p.pipfile['packages']
|
||||
|
||||
|
||||
@pytest.mark.deploy
|
||||
@pytest.mark.system
|
||||
def test_system_and_deploy_work(PipenvInstance, pypi):
|
||||
|
||||
Reference in New Issue
Block a user