From d6adc1efa579c512bf0cfcd2693e23abb1a1ac43 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Sat, 23 Jun 2018 18:15:03 -0600 Subject: [PATCH] test skipping requirements if there is a lockfile or package name is specified --- 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 a6798aa3..74705029 100644 --- a/tests/integration/test_install_basic.py +++ b/tests/integration/test_install_basic.py @@ -267,6 +267,29 @@ def test_requirements_to_pipfile(PipenvInstance, pypi): assert 'pysocks' in p.lockfile['default'] +@pytest.mark.install +@pytest.mark.requirements +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') + with open(p.pipfile_path, 'w') as f: + contents = """ +[packages] +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'] + assert 'six' in p.lockfile['default'] + 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):