From beeb60daa0ef57bdea16a769d87d8fce222c3a5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Sat, 18 Jul 2020 16:45:12 +0700 Subject: [PATCH] Test install from PyPI with fast-deps --- tests/functional/test_fast_deps.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/functional/test_fast_deps.py diff --git a/tests/functional/test_fast_deps.py b/tests/functional/test_fast_deps.py new file mode 100644 index 00000000000..77cc71e65dc --- /dev/null +++ b/tests/functional/test_fast_deps.py @@ -0,0 +1,23 @@ +import json + +from pip._vendor.packaging.utils import canonicalize_name +from pytest import mark + + +def assert_installed(script, names): + list_output = json.loads(script.pip('list', '--format=json').stdout) + installed = {canonicalize_name(item['name']) for item in list_output} + assert installed.issuperset(map(canonicalize_name, names)) + + +@mark.network +@mark.parametrize(('req', 'expected'), ( + ('Paste==3.4.2', ('Paste', 'six')), + ('Paste[flup]==3.4.2', ('Paste', 'six', 'flup')), +)) +def test_install_from_pypi(req, expected, script): + script.pip( + 'install', '--use-feature=fast-deps', + req, allow_stderr_warning=True, + ) + assert_installed(script, expected)