Skip to content

Commit ac45195

Browse files
committed
Run ruff check . --select PT007 --fix --unsafe-fixes
1 parent ddab00b commit ac45195

File tree

10 files changed

+67
-67
lines changed

10 files changed

+67
-67
lines changed

tests/functional/test_download.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,11 +1450,11 @@ def test_produces_error_for_mismatched_package_name_in_metadata(
14501450

14511451
@pytest.mark.parametrize(
14521452
"requirement",
1453-
(
1453+
[
14541454
"requires-simple-extra==0.1",
14551455
"REQUIRES_SIMPLE-EXTRA==0.1",
14561456
"REQUIRES....simple-_-EXTRA==0.1",
1457-
),
1457+
],
14581458
)
14591459
def test_canonicalizes_package_name_before_verifying_metadata(
14601460
download_local_html_index: Callable[..., Tuple[TestPipResult, Path]],

tests/functional/test_fast_deps.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ def assert_installed(script: PipTestEnvironment, names: str) -> None:
3333
@mark.network
3434
@mark.parametrize(
3535
"requirement, expected",
36-
(
36+
[
3737
("Paste==3.4.2", ("Paste", "six")),
3838
("Paste[flup]==3.4.2", ("Paste", "six", "flup")),
39-
),
39+
],
4040
)
4141
def test_install_from_pypi(
4242
requirement: str, expected: str, script: PipTestEnvironment
@@ -48,10 +48,10 @@ def test_install_from_pypi(
4848
@mark.network
4949
@mark.parametrize(
5050
"requirement, expected",
51-
(
51+
[
5252
("Paste==3.4.2", ("Paste-3.4.2-*.whl", "six-*.whl")),
5353
("Paste[flup]==3.4.2", ("Paste-3.4.2-*.whl", "six-*.whl", "flup-*")),
54-
),
54+
],
5555
)
5656
def test_download_from_pypi(
5757
requirement: str, expected: Iterable[str], script: PipTestEnvironment

tests/functional/test_install.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
)
4343

4444

45-
@pytest.mark.parametrize("command", ("install", "wheel"))
46-
@pytest.mark.parametrize("variant", ("missing_setuptools", "bad_setuptools"))
45+
@pytest.mark.parametrize("command", ["install", "wheel"])
46+
@pytest.mark.parametrize("variant", ["missing_setuptools", "bad_setuptools"])
4747
def test_pep518_uses_build_env(
4848
script: PipTestEnvironment,
4949
data: TestData,
@@ -243,10 +243,10 @@ def test_pep518_with_namespace_package(
243243
)
244244

245245

246-
@pytest.mark.parametrize("command", ("install", "wheel"))
246+
@pytest.mark.parametrize("command", ["install", "wheel"])
247247
@pytest.mark.parametrize(
248248
"package",
249-
("pep518_forkbomb", "pep518_twin_forkbombs_first", "pep518_twin_forkbombs_second"),
249+
["pep518_forkbomb", "pep518_twin_forkbombs_first", "pep518_twin_forkbombs_second"],
250250
)
251251
def test_pep518_forkbombs(
252252
script: PipTestEnvironment,
@@ -1253,7 +1253,7 @@ def test_install_nonlocal_compatible_wheel_path(
12531253
assert result.returncode == ERROR
12541254

12551255

1256-
@pytest.mark.parametrize("opt", ("--target", "--prefix"))
1256+
@pytest.mark.parametrize("opt", ["--target", "--prefix"])
12571257
def test_install_with_target_or_prefix_and_scripts_no_warning(
12581258
opt: str, script: PipTestEnvironment
12591259
) -> None:
@@ -2027,7 +2027,7 @@ def test_install_pep508_with_url_in_install_requires(
20272027

20282028

20292029
@pytest.mark.network
2030-
@pytest.mark.parametrize("index", (PyPI.simple_url, TestPyPI.simple_url))
2030+
@pytest.mark.parametrize("index", [PyPI.simple_url, TestPyPI.simple_url])
20312031
def test_install_from_test_pypi_with_ext_url_dep_is_blocked(
20322032
script: PipTestEnvironment, index: str
20332033
) -> None:
@@ -2392,7 +2392,7 @@ def test_install_skip_work_dir_pkg(script: PipTestEnvironment, data: TestData) -
23922392

23932393

23942394
@pytest.mark.parametrize(
2395-
"package_name", ("simple-package", "simple_package", "simple.package")
2395+
"package_name", ["simple-package", "simple_package", "simple.package"]
23962396
)
23972397
def test_install_verify_package_name_normalization(
23982398
script: PipTestEnvironment, package_name: str
@@ -2449,7 +2449,7 @@ def install_find_links(
24492449

24502450
@pytest.mark.parametrize(
24512451
"with_target_dir",
2452-
(True, False),
2452+
[True, False],
24532453
)
24542454
def test_install_dry_run_nothing_installed(
24552455
script: PipTestEnvironment,
@@ -2618,7 +2618,7 @@ def test_install_pip_prints_req_chain_pypi(script: PipTestEnvironment) -> None:
26182618
)
26192619

26202620

2621-
@pytest.mark.parametrize("common_prefix", ("", "linktest-1.0/"))
2621+
@pytest.mark.parametrize("common_prefix", ["", "linktest-1.0/"])
26222622
def test_install_sdist_links(script: PipTestEnvironment, common_prefix: str) -> None:
26232623
"""
26242624
Test installing an sdist with hard and symbolic links.

tests/functional/test_new_resolver.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2299,8 +2299,8 @@ def test_new_resolver_dont_backtrack_on_extra_if_base_constrained(
22992299
script.assert_installed(pkg="1.0", dep="1.0")
23002300

23012301

2302-
@pytest.mark.parametrize("swap_order", (True, False))
2303-
@pytest.mark.parametrize("two_extras", (True, False))
2302+
@pytest.mark.parametrize("swap_order", [True, False])
2303+
@pytest.mark.parametrize("two_extras", [True, False])
23042304
def test_new_resolver_dont_backtrack_on_extra_if_base_constrained_in_requirement(
23052305
script: PipTestEnvironment, swap_order: bool, two_extras: bool
23062306
) -> None:
@@ -2337,8 +2337,8 @@ def test_new_resolver_dont_backtrack_on_extra_if_base_constrained_in_requirement
23372337
script.assert_installed(pkg="1.0", dep="1.0")
23382338

23392339

2340-
@pytest.mark.parametrize("swap_order", (True, False))
2341-
@pytest.mark.parametrize("two_extras", (True, False))
2340+
@pytest.mark.parametrize("swap_order", [True, False])
2341+
@pytest.mark.parametrize("two_extras", [True, False])
23422342
def test_new_resolver_dont_backtrack_on_conflicting_constraints_on_extras(
23432343
tmpdir: pathlib.Path,
23442344
virtualenv: VirtualEnvironment,
@@ -2518,7 +2518,7 @@ def test_new_resolver_works_when_failing_package_builds_are_disallowed(
25182518
script.assert_installed(pkg2="1.0", pkg1="1.0")
25192519

25202520

2521-
@pytest.mark.parametrize("swap_order", (True, False))
2521+
@pytest.mark.parametrize("swap_order", [True, False])
25222522
def test_new_resolver_comes_from_with_extra(
25232523
script: PipTestEnvironment, swap_order: bool
25242524
) -> None:

tests/functional/test_vcs_git.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,11 @@ def _initialize_clonetest_server(
319319

320320
@pytest.mark.parametrize(
321321
"version_out, expected_message",
322-
(
322+
[
323323
("git version -2.25.1", "Can't parse git version: git version -2.25.1"),
324324
("git version 2.a.1", "Can't parse git version: git version 2.a.1"),
325325
("git ver. 2.25.1", "Can't parse git version: git ver. 2.25.1"),
326-
),
326+
],
327327
)
328328
@patch("pip._internal.vcs.versioncontrol.VersionControl.run_command")
329329
def test_git_parse_fail_warning(

tests/lib/test_lib.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ def run_with_log_command(
115115

116116
@pytest.mark.parametrize(
117117
"prefix",
118-
(
118+
[
119119
"DEBUG",
120120
"INFO",
121121
"FOO",
122-
),
122+
],
123123
)
124124
def test_run__allowed_stderr(self, script: PipTestEnvironment, prefix: str) -> None:
125125
"""
@@ -150,10 +150,10 @@ def test_run__allow_stderr_warning(self, script: PipTestEnvironment) -> None:
150150

151151
@pytest.mark.parametrize(
152152
"prefix",
153-
(
153+
[
154154
"WARNING",
155155
"ERROR",
156-
),
156+
],
157157
)
158158
def test_run__allow_stderr_error(
159159
self, script: PipTestEnvironment, prefix: str
@@ -166,10 +166,10 @@ def test_run__allow_stderr_error(
166166

167167
@pytest.mark.parametrize(
168168
"prefix, expected_start",
169-
(
169+
[
170170
("WARNING", "stderr has an unexpected warning"),
171171
("ERROR", "stderr has an unexpected error"),
172-
),
172+
],
173173
)
174174
def test_run__unexpected_stderr(
175175
self, script: PipTestEnvironment, prefix: str, expected_start: str
@@ -227,10 +227,10 @@ def test_run__allow_stderr_warning_false_error_with_expect_stderr(
227227

228228
@pytest.mark.parametrize(
229229
"arg_name",
230-
(
230+
[
231231
"expect_error",
232232
"allow_stderr_error",
233-
),
233+
],
234234
)
235235
def test_run__allow_stderr_warning_false_error(
236236
self, script: PipTestEnvironment, arg_name: str

tests/unit/metadata/test_metadata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ def test_dist_found_in_zip(tmp_path: Path) -> None:
133133

134134
@pytest.mark.parametrize(
135135
"path",
136-
(
136+
[
137137
"/path/to/foo.egg-info".replace("/", os.path.sep),
138138
# Tests issue fixed by https://github.com/pypa/pip/pull/2530
139139
"/path/to/foo.egg-info/".replace("/", os.path.sep),
140-
),
140+
],
141141
)
142142
def test_trailing_slash_directory_metadata(path: str) -> None:
143143
dist = get_directory_distribution(path)

tests/unit/test_network_auth.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,15 @@ def set_password(self, system: str, username: str, password: str) -> None:
177177

178178
@pytest.mark.parametrize(
179179
"url, expect",
180-
(
180+
[
181181
("http://example.com/path1", (None, None)),
182182
# path1 URLs will be resolved by netloc
183183
("http://[email protected]/path3", ("user", "user!netloc")),
184184
("http://[email protected]/path3", ("user2", "user2!netloc")),
185185
# path2 URLs will be resolved by index URL
186186
("http://example.com/path2/path3", (None, None)),
187187
("http://[email protected]/path2/path3", ("foo", "foo!url")),
188-
),
188+
],
189189
)
190190
def test_keyring_get_password(
191191
monkeypatch: pytest.MonkeyPatch,
@@ -257,7 +257,7 @@ def test_keyring_get_password_username_in_index(
257257

258258
@pytest.mark.parametrize(
259259
"response_status, creds, expect_save",
260-
(
260+
[
261261
(403, ("user", "pass", True), False),
262262
(
263263
200,
@@ -269,7 +269,7 @@ def test_keyring_get_password_username_in_index(
269269
("user", "pass", False),
270270
False,
271271
),
272-
),
272+
],
273273
)
274274
def test_keyring_set_password(
275275
monkeypatch: pytest.MonkeyPatch,
@@ -345,11 +345,11 @@ def get_credential(self, system: str, username: str) -> Optional[Credential]:
345345

346346
@pytest.mark.parametrize(
347347
"url, expect",
348-
(
348+
[
349349
("http://example.com/path1", ("username", "netloc")),
350350
("http://example.com/path2/path3", ("username", "url")),
351351
("http://[email protected]/path2/path3", ("username", "url")),
352-
),
352+
],
353353
)
354354
def test_keyring_get_credential(
355355
monkeypatch: pytest.MonkeyPatch, url: str, expect: Tuple[str, str]
@@ -442,15 +442,15 @@ def check_returncode(self) -> None:
442442

443443
@pytest.mark.parametrize(
444444
"url, expect",
445-
(
445+
[
446446
("http://example.com/path1", (None, None)),
447447
# path1 URLs will be resolved by netloc
448448
("http://[email protected]/path3", ("user", "user!netloc")),
449449
("http://[email protected]/path3", ("user2", "user2!netloc")),
450450
# path2 URLs will be resolved by index URL
451451
("http://example.com/path2/path3", (None, None)),
452452
("http://[email protected]/path2/path3", ("foo", "foo!url")),
453-
),
453+
],
454454
)
455455
def test_keyring_cli_get_password(
456456
monkeypatch: pytest.MonkeyPatch,
@@ -472,7 +472,7 @@ def test_keyring_cli_get_password(
472472

473473
@pytest.mark.parametrize(
474474
"response_status, creds, expect_save",
475-
(
475+
[
476476
(403, ("user", "pass", True), False),
477477
(
478478
200,
@@ -484,7 +484,7 @@ def test_keyring_cli_get_password(
484484
("user", "pass", False),
485485
False,
486486
),
487-
),
487+
],
488488
)
489489
def test_keyring_cli_set_password(
490490
monkeypatch: pytest.MonkeyPatch,

0 commit comments

Comments
 (0)