7
7
from typing import Iterable
8
8
9
9
from pip ._vendor .packaging .utils import canonicalize_name
10
- from pytest import mark
10
+ import pytest
11
11
12
12
from pip ._internal .utils .misc import hash_file
13
13
from tests .lib import PipTestEnvironment , TestData , TestPipResult
@@ -30,8 +30,8 @@ def assert_installed(script: PipTestEnvironment, names: str) -> None:
30
30
assert installed .issuperset (map (canonicalize_name , names ))
31
31
32
32
33
- @mark .network
34
- @mark .parametrize (
33
+ @pytest . mark .network
34
+ @pytest . mark .parametrize (
35
35
"requirement, expected" ,
36
36
[
37
37
("Paste==3.4.2" , ("Paste" , "six" )),
@@ -45,8 +45,8 @@ def test_install_from_pypi(
45
45
assert_installed (script , expected )
46
46
47
47
48
- @mark .network
49
- @mark .parametrize (
48
+ @pytest . mark .network
49
+ @pytest . mark .parametrize (
50
50
"requirement, expected" ,
51
51
[
52
52
("Paste==3.4.2" , ("Paste-3.4.2-*.whl" , "six-*.whl" )),
@@ -61,7 +61,7 @@ def test_download_from_pypi(
61
61
assert all (fnmatch .filter (created , f ) for f in expected )
62
62
63
63
64
- @mark .network
64
+ @pytest . mark .network
65
65
def test_build_wheel_with_deps (data : TestData , script : PipTestEnvironment ) -> None :
66
66
result = pip (script , "wheel" , os .fspath (data .packages / "requiresPaste" ))
67
67
created = [basename (f ) for f in result .files_created ]
@@ -70,7 +70,7 @@ def test_build_wheel_with_deps(data: TestData, script: PipTestEnvironment) -> No
70
70
assert fnmatch .filter (created , "six-*.whl" )
71
71
72
72
73
- @mark .network
73
+ @pytest . mark .network
74
74
def test_require_hash (script : PipTestEnvironment , tmp_path : pathlib .Path ) -> None :
75
75
reqs = tmp_path / "requirements.txt"
76
76
reqs .write_text (
@@ -91,7 +91,7 @@ def test_require_hash(script: PipTestEnvironment, tmp_path: pathlib.Path) -> Non
91
91
assert fnmatch .filter (created , "idna-2.10*" )
92
92
93
93
94
- @mark .network
94
+ @pytest . mark .network
95
95
def test_hash_mismatch (script : PipTestEnvironment , tmp_path : pathlib .Path ) -> None :
96
96
reqs = tmp_path / "requirements.txt"
97
97
reqs .write_text ("idna==2.10 --hash=sha256:irna" )
@@ -105,7 +105,7 @@ def test_hash_mismatch(script: PipTestEnvironment, tmp_path: pathlib.Path) -> No
105
105
assert "DO NOT MATCH THE HASHES" in result .stderr
106
106
107
107
108
- @mark .network
108
+ @pytest . mark .network
109
109
def test_hash_mismatch_existing_download_for_metadata_only_wheel (
110
110
script : PipTestEnvironment , tmp_path : pathlib .Path
111
111
) -> None :
0 commit comments