From b2f6932a131bfe1ec501eb1751ac8a87d5fecc4f Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sat, 23 Jun 2018 19:57:06 -0400 Subject: [PATCH] Add tests for #2309 Signed-off-by: Dan Ryan --- tests/integration/test_install_basic.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/integration/test_install_basic.py b/tests/integration/test_install_basic.py index 3fb04e4c..a992d49a 100644 --- a/tests/integration/test_install_basic.py +++ b/tests/integration/test_install_basic.py @@ -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']