From 91a63e07e2efe255e8094b38f4d30096de3d55c4 Mon Sep 17 00:00:00 2001 From: jxltom Date: Sun, 21 Oct 2018 12:53:33 +0800 Subject: [PATCH] Add test on locking package with extras --- tests/integration/test_lock.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/integration/test_lock.py b/tests/integration/test_lock.py index ac296476..1f1719d0 100644 --- a/tests/integration/test_lock.py +++ b/tests/integration/test_lock.py @@ -167,6 +167,28 @@ maya = "*" assert c.return_code == 0 +@pytest.mark.extras +@pytest.mark.lock +def test_lock_extras_without_install(PipenvInstance, pypi): + with PipenvInstance(pypi=pypi) as p: + with open(p.pipfile_path, 'w') as f: + contents = """ +[packages] +requests = {version = "*", extras = ["socks"]} + """.strip() + f.write(contents) + + c = p.pipenv('lock') + assert c.return_code == 0 + assert "requests" in p.lockfile["default"] + assert "pysocks" in p.lockfile["default"] + assert "markers" not in p.lockfile["default"]['pysocks'] + + c = p.pipenv('lock -r') + assert c.return_code == 0 + assert "extra == 'socks'" not in c.out.strip() + + @pytest.mark.extras @pytest.mark.lock @pytest.mark.complex