Skip to content

Commit

Permalink
Enforce CSV parametrize names style
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Aug 7, 2024
1 parent f2469cb commit 8ca53b3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Tests/test_file_dds.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def test_sanity_ati2_bc5u(image_path: str) -> None:


@pytest.mark.parametrize(
("image_path", "expected_path"),
"image_path, expected_path",
(
# hexeditted to be typeless
(TEST_FILE_DX10_BC5_TYPELESS, TEST_FILE_DX10_BC5_UNORM),
Expand Down Expand Up @@ -248,7 +248,7 @@ def test_dx10_r8g8b8a8_unorm_srgb() -> None:


@pytest.mark.parametrize(
("mode", "size", "test_file"),
"mode, size, test_file",
[
("L", (128, 128), TEST_FILE_UNCOMPRESSED_L),
("LA", (128, 128), TEST_FILE_UNCOMPRESSED_L_WITH_ALPHA),
Expand Down Expand Up @@ -373,7 +373,7 @@ def test_save_unsupported_mode(tmp_path: Path) -> None:


@pytest.mark.parametrize(
("mode", "test_file"),
"mode, test_file",
[
("L", "Tests/images/linear_gradient.png"),
("LA", "Tests/images/uncompressed_la.png"),
Expand Down
4 changes: 1 addition & 3 deletions Tests/test_file_eps.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@


@pytest.mark.skipif(not HAS_GHOSTSCRIPT, reason="Ghostscript not available")
@pytest.mark.parametrize(
("filename", "size"), ((FILE1, (460, 352)), (FILE2, (360, 252)))
)
@pytest.mark.parametrize("filename, size", ((FILE1, (460, 352)), (FILE2, (360, 252))))
@pytest.mark.parametrize("scale", (1, 2))
def test_sanity(filename: str, size: tuple[int, int], scale: int) -> None:
expected_size = tuple(s * scale for s in size)
Expand Down
2 changes: 1 addition & 1 deletion Tests/test_image_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def test_putpixel_type_error1(self, mode: str) -> None:
im.putpixel((0, 0), v) # type: ignore[arg-type]

@pytest.mark.parametrize(
("mode", "band_numbers", "match"),
"mode, band_numbers, match",
(
("L", (0, 2), "color must be int or single-element tuple"),
("LA", (0, 3), "color must be int, or tuple of one or two elements"),
Expand Down
2 changes: 1 addition & 1 deletion Tests/test_pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def helper_pickle_string(protocol: int, test_file: str, mode: str | None) -> Non


@pytest.mark.parametrize(
("test_file", "test_mode"),
"test_file, test_mode",
[
("Tests/images/hopper.jpg", None),
("Tests/images/hopper.jpg", "L"),
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ lint.select = [
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"PGH", # pygrep-hooks
"PT006", # pytest-parametrize-names-wrong-type
"PYI", # flake8-pyi
"RUF100", # unused noqa (yesqa)
"UP", # pyupgrade
Expand All @@ -129,6 +130,8 @@ lint.per-file-ignores."Tests/oss-fuzz/fuzz_font.py" = [
lint.per-file-ignores."Tests/oss-fuzz/fuzz_pillow.py" = [
"I002",
]
lint.flake8-pytest-style.parametrize-names-type = "csv"

lint.isort.known-first-party = [
"PIL",
]
Expand Down

0 comments on commit 8ca53b3

Please sign in to comment.