From a64ab3ee135ff7c38a1ca10451bb57540753df90 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 | 27 +++++++++++++++++++++++++++ 1 file changed, 27 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..ff9c37e90d7 --- /dev/null +++ b/tests/functional/test_fast_deps.py @@ -0,0 +1,27 @@ +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(('spec', 'expected'), ( + ('mypy==0.782', ( + 'mypy', 'mypy-extensions', 'typed-ast', 'typing-extensions', + )), + ('mypy[dmypy]==0.782', ( + 'mypy', 'mypy-extensions', 'typed-ast', 'typing-extensions', 'psutil', + )), +)) +def test_install_from_pypi(spec, expected, script): + script.pip( + 'install', '--use-feature=2020-resolver', '--use-feature=fast-deps', + spec, allow_stderr_warning=True, + ) + assert_installed(script, expected)