From 8b7af50d3356ef30b6b3d9d6dd71c9eff66122df Mon Sep 17 00:00:00 2001 From: Vincent Philippon Date: Mon, 13 Nov 2017 23:16:06 -0500 Subject: [PATCH] Test causing a change of candidate in locking iteration. --- tests/test_pipenv.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/test_pipenv.py b/tests/test_pipenv.py index 453dc66d..5127bd89 100644 --- a/tests/test_pipenv.py +++ b/tests/test_pipenv.py @@ -1,4 +1,5 @@ import os +from pkg_resources import parse_version import re import tempfile import shutil @@ -820,6 +821,28 @@ maya = "*" c = p.pipenv('install') assert c.return_code == 0 + @pytest.mark.lock + @pytest.mark.requirements + @pytest.mark.complex + def test_complex_lock_changing_candidate(self): + # The requests candidate will change from latest to <2.12. + + with PipenvInstance() as p: + with open(p.pipfile_path, 'w') as f: + contents = """ +[packages] +"docker-compose" = "==1.16.0" +requests = "*" + """.strip() + f.write(contents) + + c = p.pipenv('lock') + assert c.return_code == 0 + assert parse_version(p.lockfile['default']['requests']['version'][2:]) < parse_version('2.12') + + c = p.pipenv('install') + assert c.return_code == 0 + @pytest.mark.lock @pytest.mark.deploy def test_deploy_works(self):