Skip to content

Commit e8a3af7

Browse files
committed
Enforce CSV parametrize names style
1 parent f2469cb commit e8a3af7

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

Tests/test_file_dds.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def test_sanity_ati2_bc5u(image_path: str) -> None:
152152

153153

154154
@pytest.mark.parametrize(
155-
("image_path", "expected_path"),
155+
"image_path,expected_path",
156156
(
157157
# hexeditted to be typeless
158158
(TEST_FILE_DX10_BC5_TYPELESS, TEST_FILE_DX10_BC5_UNORM),
@@ -248,7 +248,7 @@ def test_dx10_r8g8b8a8_unorm_srgb() -> None:
248248

249249

250250
@pytest.mark.parametrize(
251-
("mode", "size", "test_file"),
251+
"mode,size,test_file",
252252
[
253253
("L", (128, 128), TEST_FILE_UNCOMPRESSED_L),
254254
("LA", (128, 128), TEST_FILE_UNCOMPRESSED_L_WITH_ALPHA),
@@ -373,7 +373,7 @@ def test_save_unsupported_mode(tmp_path: Path) -> None:
373373

374374

375375
@pytest.mark.parametrize(
376-
("mode", "test_file"),
376+
"mode,test_file",
377377
[
378378
("L", "Tests/images/linear_gradient.png"),
379379
("LA", "Tests/images/uncompressed_la.png"),

Tests/test_file_eps.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@
8080

8181

8282
@pytest.mark.skipif(not HAS_GHOSTSCRIPT, reason="Ghostscript not available")
83-
@pytest.mark.parametrize(
84-
("filename", "size"), ((FILE1, (460, 352)), (FILE2, (360, 252)))
85-
)
83+
@pytest.mark.parametrize("filename,size", ((FILE1, (460, 352)), (FILE2, (360, 252))))
8684
@pytest.mark.parametrize("scale", (1, 2))
8785
def test_sanity(filename: str, size: tuple[int, int], scale: int) -> None:
8886
expected_size = tuple(s * scale for s in size)

Tests/test_image_access.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def test_putpixel_type_error1(self, mode: str) -> None:
230230
im.putpixel((0, 0), v) # type: ignore[arg-type]
231231

232232
@pytest.mark.parametrize(
233-
("mode", "band_numbers", "match"),
233+
"mode,band_numbers,match",
234234
(
235235
("L", (0, 2), "color must be int or single-element tuple"),
236236
("LA", (0, 3), "color must be int, or tuple of one or two elements"),

Tests/test_pickle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def helper_pickle_string(protocol: int, test_file: str, mode: str | None) -> Non
4646

4747

4848
@pytest.mark.parametrize(
49-
("test_file", "test_mode"),
49+
"test_file,test_mode",
5050
[
5151
("Tests/images/hopper.jpg", None),
5252
("Tests/images/hopper.jpg", "L"),

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ lint.select = [
109109
"ISC", # flake8-implicit-str-concat
110110
"LOG", # flake8-logging
111111
"PGH", # pygrep-hooks
112+
"PT006", # pytest-parametrize-names-wrong-type
112113
"PYI", # flake8-pyi
113114
"RUF100", # unused noqa (yesqa)
114115
"UP", # pyupgrade
@@ -129,6 +130,8 @@ lint.per-file-ignores."Tests/oss-fuzz/fuzz_font.py" = [
129130
lint.per-file-ignores."Tests/oss-fuzz/fuzz_pillow.py" = [
130131
"I002",
131132
]
133+
lint.flake8-pytest-style.parametrize-names-type = "csv"
134+
132135
lint.isort.known-first-party = [
133136
"PIL",
134137
]

0 commit comments

Comments
 (0)