Skip to content

Commit ac0e4f8

Browse files
authored
Set Ruff's pytest's parametrize-names-type to default (tuple) (#4730)
2 parents b27393a + 879ad20 commit ac0e4f8

18 files changed

+42
-44
lines changed

pkg_resources/tests/test_pkg_resources.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def make_distribution_no_version(tmpdir, basename):
236236

237237

238238
@pytest.mark.parametrize(
239-
'suffix, expected_filename, expected_dist_type',
239+
("suffix", "expected_filename", "expected_dist_type"),
240240
[
241241
('egg-info', 'PKG-INFO', EggInfoDistribution),
242242
('dist-info', 'METADATA', DistInfoDistribution),
@@ -376,7 +376,7 @@ def test_version_resolved_from_egg_info(self, env):
376376
assert dist.version == version
377377

378378
@pytest.mark.parametrize(
379-
'unnormalized, normalized',
379+
("unnormalized", "normalized"),
380380
[
381381
('foo', 'foo'),
382382
('foo/', 'foo'),
@@ -398,7 +398,7 @@ def test_normalize_path_trailing_sep(self, unnormalized, normalized):
398398
reason='Testing case-insensitive filesystems.',
399399
)
400400
@pytest.mark.parametrize(
401-
'unnormalized, normalized',
401+
("unnormalized", "normalized"),
402402
[
403403
('MiXeD/CasE', 'mixed/case'),
404404
],
@@ -414,7 +414,7 @@ def test_normalize_path_normcase(self, unnormalized, normalized):
414414
reason='Testing systems using backslashes as path separators.',
415415
)
416416
@pytest.mark.parametrize(
417-
'unnormalized, expected',
417+
("unnormalized", "expected"),
418418
[
419419
('forward/slash', 'forward\\slash'),
420420
('forward/slash/', 'forward\\slash'),

pkg_resources/tests/test_resources.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ def test_spaces_between_multiple_versions(self):
700700
(req,) = parse_requirements('foo >= 1.0, < 3')
701701

702702
@pytest.mark.parametrize(
703-
'lower, upper',
703+
("lower", "upper"),
704704
[
705705
('1.2-rc1', '1.2rc1'),
706706
('0.4', '0.4.0'),
@@ -724,7 +724,7 @@ def testVersionEquality(self, lower, upper):
724724
"""
725725

726726
@pytest.mark.parametrize(
727-
'lower, upper',
727+
("lower", "upper"),
728728
[
729729
('2.1', '2.1.1'),
730730
('2a1', '2b0'),

ruff.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ sections.delayed = ["distutils"]
8181
[lint.flake8-annotations]
8282
ignore-fully-untyped = true
8383

84-
[lint.flake8-pytest-style]
85-
parametrize-names-type = "csv"
86-
8784
[format]
8885
# Enable preview to get hugged parenthesis unwrapping and other nice surprises
8986
# See https://github.com/jaraco/skeleton/pull/133#issuecomment-2239538373

setuptools/tests/config/test_apply_pyprojecttoml.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def test_pep621_example(tmp_path):
183183

184184

185185
@pytest.mark.parametrize(
186-
"readme, ctype",
186+
("readme", "ctype"),
187187
[
188188
("Readme.txt", "text/plain"),
189189
("readme.md", "text/markdown"),
@@ -209,7 +209,7 @@ def test_no_explicit_content_type_for_missing_extension(tmp_path):
209209

210210

211211
@pytest.mark.parametrize(
212-
'pyproject_text, expected_maintainers_meta_value',
212+
("pyproject_text", "expected_maintainers_meta_value"),
213213
(
214214
pytest.param(
215215
PEP621_EXAMPLE,
@@ -370,7 +370,7 @@ def pyproject(self, tmp_path, dynamic, extra_content=""):
370370
return file
371371

372372
@pytest.mark.parametrize(
373-
"attr, field, value",
373+
("attr", "field", "value"),
374374
[
375375
("classifiers", "classifiers", ["Private :: Classifier"]),
376376
("entry_points", "scripts", {"console_scripts": ["foobar=foobar:main"]}),
@@ -395,7 +395,7 @@ def test_not_listed_in_dynamic(self, tmp_path, attr, field, value):
395395
assert not dist_value
396396

397397
@pytest.mark.parametrize(
398-
"attr, field, value",
398+
("attr", "field", "value"),
399399
[
400400
("install_requires", "dependencies", []),
401401
("extras_require", "optional-dependencies", {}),
@@ -442,7 +442,8 @@ def test_optional_dependencies_dont_remove_env_markers(self, tmp_path):
442442
assert ':python_version < "3.7"' in reqs
443443

444444
@pytest.mark.parametrize(
445-
"field,group", [("scripts", "console_scripts"), ("gui-scripts", "gui_scripts")]
445+
("field", "group"),
446+
[("scripts", "console_scripts"), ("gui-scripts", "gui_scripts")],
446447
)
447448
@pytest.mark.filterwarnings("error")
448449
def test_scripts_dont_require_dynamic_entry_points(self, tmp_path, field, group):

setuptools/tests/config/test_expand.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def test_import_order(self, tmp_path):
141141

142142

143143
@pytest.mark.parametrize(
144-
'package_dir, file, module, return_value',
144+
("package_dir", "file", "module", "return_value"),
145145
[
146146
({"": "src"}, "src/pkg/main.py", "pkg.main", 42),
147147
({"pkg": "lib"}, "lib/main.py", "pkg.main", 13),
@@ -158,7 +158,7 @@ def test_resolve_class(monkeypatch, tmp_path, package_dir, file, module, return_
158158

159159

160160
@pytest.mark.parametrize(
161-
'args, pkgs',
161+
("args", "pkgs"),
162162
[
163163
({"where": ["."], "namespaces": False}, {"pkg", "other"}),
164164
({"where": [".", "dir1"], "namespaces": False}, {"pkg", "other", "dir2"}),
@@ -192,7 +192,7 @@ def test_find_packages(tmp_path, args, pkgs):
192192

193193

194194
@pytest.mark.parametrize(
195-
"files, where, expected_package_dir",
195+
("files", "where", "expected_package_dir"),
196196
[
197197
(["pkg1/__init__.py", "pkg1/other.py"], ["."], {}),
198198
(["pkg1/__init__.py", "pkg2/__init__.py"], ["."], {}),

setuptools/tests/config/test_pyprojecttoml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def test_read_configuration(tmp_path):
149149

150150

151151
@pytest.mark.parametrize(
152-
"pkg_root, opts",
152+
("pkg_root", "opts"),
153153
[
154154
(".", {}),
155155
("src", {}),
@@ -308,7 +308,7 @@ def test_ignore_unrelated_config(tmp_path, example):
308308

309309

310310
@pytest.mark.parametrize(
311-
"example, error_msg",
311+
("example", "error_msg"),
312312
[
313313
(
314314
"""

setuptools/tests/integration/test_pip_install_sdist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def _prepare(tmp_path, venv_python, monkeypatch):
122122
run([venv_python, "-m", "pip", "freeze"])
123123

124124

125-
@pytest.mark.parametrize('package, version', EXAMPLES)
125+
@pytest.mark.parametrize(("package", "version"), EXAMPLES)
126126
@pytest.mark.uses_network
127127
def test_install_sdist(package, version, tmp_path, venv_python, setuptools_wheel):
128128
venv_pip = (venv_python, "-m", "pip")

setuptools/tests/test_bdist_wheel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def test_licenses_deprecated(dummy_dist, monkeypatch, tmp_path):
322322

323323

324324
@pytest.mark.parametrize(
325-
"config_file, config",
325+
("config_file", "config"),
326326
[
327327
("setup.cfg", "[metadata]\nlicense_files=licenses/*\n LICENSE"),
328328
("setup.cfg", "[metadata]\nlicense_files=licenses/*, LICENSE"),
@@ -434,7 +434,7 @@ def test_build_from_readonly_tree(dummy_dist, monkeypatch, tmp_path):
434434

435435

436436
@pytest.mark.parametrize(
437-
"option, compress_type",
437+
("option", "compress_type"),
438438
list(bdist_wheel.supported_compressions.items()),
439439
ids=list(bdist_wheel.supported_compressions),
440440
)
@@ -589,7 +589,7 @@ def test_data_dir_with_tag_build(monkeypatch, tmp_path):
589589

590590

591591
@pytest.mark.parametrize(
592-
"reported,expected",
592+
("reported", "expected"),
593593
[("linux-x86_64", "linux_i686"), ("linux-aarch64", "linux_armv7l")],
594594
)
595595
@pytest.mark.skipif(

setuptools/tests/test_build_meta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ def test_editable_with_config_settings(self, tmpdir_cwd, config_settings):
737737
self._assert_link_tree(next(Path("build").glob("__editable__.*")))
738738

739739
@pytest.mark.parametrize(
740-
'setup_literal, requirements',
740+
("setup_literal", "requirements"),
741741
[
742742
("'foo'", ['foo']),
743743
("['foo']", ['foo']),

setuptools/tests/test_config_discovery.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def test_project(self, tmp_path, circumstance):
161161
}
162162

163163
@pytest.mark.parametrize(
164-
"config_file, param, circumstance",
164+
("config_file", "param", "circumstance"),
165165
product(
166166
["setup.cfg", "setup.py", "pyproject.toml"],
167167
["packages", "py_modules"],
@@ -191,7 +191,7 @@ def test_purposefully_empty(self, tmp_path, config_file, param, circumstance):
191191
assert getattr(dist, other) is None
192192

193193
@pytest.mark.parametrize(
194-
"extra_files, pkgs",
194+
("extra_files", "pkgs"),
195195
[
196196
(["venv/bin/simulate_venv"], {"pkg"}),
197197
(["pkg-stubs/__init__.pyi"], {"pkg", "pkg-stubs"}),
@@ -284,7 +284,7 @@ def test_build_with_discovered_name(self, tmp_path):
284284

285285
class TestWithAttrDirective:
286286
@pytest.mark.parametrize(
287-
"folder, opts",
287+
("folder", "opts"),
288288
[
289289
("src", {}),
290290
("lib", {"packages": "find:", "packages.find": {"where": "lib"}}),
@@ -446,7 +446,7 @@ def _simulate_package_with_data_files(self, tmp_path, src_root):
446446
"""
447447

448448
@pytest.mark.parametrize(
449-
"src_root, files",
449+
("src_root", "files"),
450450
[
451451
(".", {"setup.cfg": DALS(EXAMPLE_SETUPCFG)}),
452452
(".", {"pyproject.toml": DALS(EXAMPLE_PYPROJECT)}),

0 commit comments

Comments
 (0)