Skip to content

Commit

Permalink
Add tests for #2309
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Ryan <[email protected]>
  • Loading branch information
techalchemy committed Jun 23, 2018
1 parent 6b8649f commit b2f6932
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/integration/test_install_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,3 +332,26 @@ def test_install_venv_project_directory(PipenvInstance, pypi):
assert c.return_code == 0
project = Project()
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']

0 comments on commit b2f6932

Please sign in to comment.