Skip to content

Commit

Permalink
Test install from PyPI with fast-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
McSinyx committed Jul 18, 2020
1 parent 7492941 commit a64ab3e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/functional/test_fast_deps.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit a64ab3e

Please sign in to comment.