Skip to content

Commit a64ab3e

Browse files
committed
Test install from PyPI with fast-deps
1 parent 7492941 commit a64ab3e

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/functional/test_fast_deps.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import json
2+
3+
from pip._vendor.packaging.utils import canonicalize_name
4+
from pytest import mark
5+
6+
7+
def assert_installed(script, names):
8+
list_output = json.loads(script.pip('list', '--format=json').stdout)
9+
installed = {canonicalize_name(item['name']) for item in list_output}
10+
assert installed.issuperset(map(canonicalize_name, names))
11+
12+
13+
@mark.network
14+
@mark.parametrize(('spec', 'expected'), (
15+
('mypy==0.782', (
16+
'mypy', 'mypy-extensions', 'typed-ast', 'typing-extensions',
17+
)),
18+
('mypy[dmypy]==0.782', (
19+
'mypy', 'mypy-extensions', 'typed-ast', 'typing-extensions', 'psutil',
20+
)),
21+
))
22+
def test_install_from_pypi(spec, expected, script):
23+
script.pip(
24+
'install', '--use-feature=2020-resolver', '--use-feature=fast-deps',
25+
spec, allow_stderr_warning=True,
26+
)
27+
assert_installed(script, expected)

0 commit comments

Comments
 (0)