Skip to content

Commit b4ba735

Browse files
committed
Manually fix PT013
1 parent 612d1f1 commit b4ba735

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

tests/functional/test_fast_deps.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from typing import Iterable
88

99
from pip._vendor.packaging.utils import canonicalize_name
10-
from pytest import mark
10+
import pytest
1111

1212
from pip._internal.utils.misc import hash_file
1313
from tests.lib import PipTestEnvironment, TestData, TestPipResult
@@ -30,8 +30,8 @@ def assert_installed(script: PipTestEnvironment, names: str) -> None:
3030
assert installed.issuperset(map(canonicalize_name, names))
3131

3232

33-
@mark.network
34-
@mark.parametrize(
33+
@pytest.mark.network
34+
@pytest.mark.parametrize(
3535
"requirement, expected",
3636
[
3737
("Paste==3.4.2", ("Paste", "six")),
@@ -45,8 +45,8 @@ def test_install_from_pypi(
4545
assert_installed(script, expected)
4646

4747

48-
@mark.network
49-
@mark.parametrize(
48+
@pytest.mark.network
49+
@pytest.mark.parametrize(
5050
"requirement, expected",
5151
[
5252
("Paste==3.4.2", ("Paste-3.4.2-*.whl", "six-*.whl")),
@@ -61,7 +61,7 @@ def test_download_from_pypi(
6161
assert all(fnmatch.filter(created, f) for f in expected)
6262

6363

64-
@mark.network
64+
@pytest.mark.network
6565
def test_build_wheel_with_deps(data: TestData, script: PipTestEnvironment) -> None:
6666
result = pip(script, "wheel", os.fspath(data.packages / "requiresPaste"))
6767
created = [basename(f) for f in result.files_created]
@@ -70,7 +70,7 @@ def test_build_wheel_with_deps(data: TestData, script: PipTestEnvironment) -> No
7070
assert fnmatch.filter(created, "six-*.whl")
7171

7272

73-
@mark.network
73+
@pytest.mark.network
7474
def test_require_hash(script: PipTestEnvironment, tmp_path: pathlib.Path) -> None:
7575
reqs = tmp_path / "requirements.txt"
7676
reqs.write_text(
@@ -91,7 +91,7 @@ def test_require_hash(script: PipTestEnvironment, tmp_path: pathlib.Path) -> Non
9191
assert fnmatch.filter(created, "idna-2.10*")
9292

9393

94-
@mark.network
94+
@pytest.mark.network
9595
def test_hash_mismatch(script: PipTestEnvironment, tmp_path: pathlib.Path) -> None:
9696
reqs = tmp_path / "requirements.txt"
9797
reqs.write_text("idna==2.10 --hash=sha256:irna")
@@ -105,7 +105,7 @@ def test_hash_mismatch(script: PipTestEnvironment, tmp_path: pathlib.Path) -> No
105105
assert "DO NOT MATCH THE HASHES" in result.stderr
106106

107107

108-
@mark.network
108+
@pytest.mark.network
109109
def test_hash_mismatch_existing_download_for_metadata_only_wheel(
110110
script: PipTestEnvironment, tmp_path: pathlib.Path
111111
) -> None:

tests/unit/test_network_lazy_wheel.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Iterator
22

3+
import pytest
34
from pip._vendor.packaging.version import Version
4-
from pytest import fixture, mark, raises
55

66
from pip._internal.exceptions import InvalidWheel
77
from pip._internal.network.lazy_wheel import (
@@ -25,12 +25,12 @@
2525
}
2626

2727

28-
@fixture
28+
@pytest.fixture
2929
def session() -> PipSession:
3030
return PipSession()
3131

3232

33-
@fixture
33+
@pytest.fixture
3434
def mypy_whl_no_range(mock_server: MockServer, shared_data: TestData) -> Iterator[str]:
3535
mypy_whl = shared_data.packages / "mypy-0.782-py3-none-any.whl"
3636
mock_server.set_responses([file_response(mypy_whl)])
@@ -40,7 +40,7 @@ def mypy_whl_no_range(mock_server: MockServer, shared_data: TestData) -> Iterato
4040
mock_server.stop()
4141

4242

43-
@mark.network
43+
@pytest.mark.network
4444
def test_dist_from_wheel_url(session: PipSession) -> None:
4545
"""Test if the acquired distribution contain correct information."""
4646
dist = dist_from_wheel_url("mypy", MYPY_0_782_WHL, session)
@@ -55,12 +55,12 @@ def test_dist_from_wheel_url_no_range(
5555
session: PipSession, mypy_whl_no_range: str
5656
) -> None:
5757
"""Test handling when HTTP range requests are not supported."""
58-
with raises(HTTPRangeRequestUnsupported):
58+
with pytest.raises(HTTPRangeRequestUnsupported):
5959
dist_from_wheel_url("mypy", mypy_whl_no_range, session)
6060

6161

62-
@mark.network
62+
@pytest.mark.network
6363
def test_dist_from_wheel_url_not_zip(session: PipSession) -> None:
6464
"""Test handling with the given URL does not point to a ZIP."""
65-
with raises(InvalidWheel):
65+
with pytest.raises(InvalidWheel):
6666
dist_from_wheel_url("python", "https://www.python.org/", session)

0 commit comments

Comments
 (0)