diff --git a/Tests/test_image_filter.py b/Tests/test_image_filter.py index bec7f21e9..07f4d08ad 100644 --- a/Tests/test_image_filter.py +++ b/Tests/test_image_filter.py @@ -74,7 +74,7 @@ def test_modefilter(mode, expected): @pytest.mark.parametrize( - "mode,expected", + "mode, expected", ( ("1", (0, 4, 8)), ("L", (0, 4, 8)), diff --git a/Tests/test_image_reduce.py b/Tests/test_image_reduce.py index 90beeeb68..801161511 100644 --- a/Tests/test_image_reduce.py +++ b/Tests/test_image_reduce.py @@ -39,7 +39,7 @@ gradients_image.load() @pytest.mark.parametrize( - "size,expected", + "size, expected", ( (3, (4, 4)), ((3, 1), (4, 10)), @@ -52,16 +52,16 @@ def test_args_factor(size, expected): @pytest.mark.parametrize( - "size,error", ((0, ValueError), (2.0, TypeError), ((0, 10), ValueError)) + "size, expected_error", ((0, ValueError), (2.0, TypeError), ((0, 10), ValueError)) ) -def test_args_factor_error(size, error): +def test_args_factor_error(size, expected_error): im = Image.new("L", (10, 10)) - with pytest.raises(error): + with pytest.raises(expected_error): im.reduce(size) @pytest.mark.parametrize( - "size,expected", + "size, expected", ( ((0, 0, 10, 10), (5, 5)), ((5, 5, 6, 6), (1, 1)), @@ -73,7 +73,7 @@ def test_args_box(size, expected): @pytest.mark.parametrize( - "size,error", + "size, expected_error", ( ("stri", TypeError), ((0, 0, 11, 10), ValueError), @@ -84,9 +84,9 @@ def test_args_box(size, expected): ((5, 0, 5, 10), ValueError), ), ) -def test_args_box_error(size, error): +def test_args_box_error(size, expected_error): im = Image.new("L", (10, 10)) - with pytest.raises(error): + with pytest.raises(expected_error): im.reduce(2, size).size diff --git a/Tests/test_image_transform.py b/Tests/test_image_transform.py index 14ca0334a..a78349801 100644 --- a/Tests/test_image_transform.py +++ b/Tests/test_image_transform.py @@ -76,14 +76,14 @@ class TestImageTransform: assert_image_equal(transformed, scaled) @pytest.mark.parametrize( - "mode,pixel", + "mode, expected_pixel", ( ("RGB", (255, 0, 0)), ("RGBA", (255, 0, 0, 255)), ("LA", (76, 0)), ), ) - def test_fill(self, mode, pixel): + def test_fill(self, mode, expected_pixel): im = hopper(mode) (w, h) = im.size transformed = im.transform( @@ -93,7 +93,7 @@ class TestImageTransform: Image.Resampling.BILINEAR, fillcolor="red", ) - assert transformed.getpixel((w - 1, h - 1)) == pixel + assert transformed.getpixel((w - 1, h - 1)) == expected_pixel def test_mesh(self): # this should be a checkerboard of halfsized hoppers in ul, lr @@ -240,7 +240,7 @@ class TestImageTransformAffine: return im.crop((10, 20, im.width - 10, im.height - 20)) @pytest.mark.parametrize( - "deg,transpose", + "deg, transpose", ( (0, None), (90, Image.Transpose.ROTATE_90), @@ -281,7 +281,7 @@ class TestImageTransformAffine: assert_image_equal(transposed, transformed) @pytest.mark.parametrize( - "scale,epsilonscale", + "scale, epsilon_scale", ( (1.1, 6.9), (1.5, 5.5), @@ -298,7 +298,7 @@ class TestImageTransformAffine: (Image.Resampling.BICUBIC, 1), ), ) - def test_resize(self, scale, epsilonscale, resample, epsilon): + def test_resize(self, scale, epsilon_scale, resample, epsilon): im = self._test_image() size_up = int(round(im.width * scale)), int(round(im.height * scale)) @@ -309,10 +309,10 @@ class TestImageTransformAffine: transformed = transformed.transform( im.size, self.transform, matrix_down, resample ) - assert_image_similar(transformed, im, epsilon * epsilonscale) + assert_image_similar(transformed, im, epsilon * epsilon_scale) @pytest.mark.parametrize( - "x,y,epsilonscale", + "x, y, epsilon_scale", ( (0.1, 0, 3.7), (0.6, 0, 9.1), @@ -320,14 +320,14 @@ class TestImageTransformAffine: ), ) @pytest.mark.parametrize( - "resample,epsilon", + "resample, epsilon", ( (Image.Resampling.NEAREST, 0), (Image.Resampling.BILINEAR, 1.5), (Image.Resampling.BICUBIC, 1), ), ) - def test_translate(self, x, y, epsilonscale, resample, epsilon): + def test_translate(self, x, y, epsilon_scale, resample, epsilon): im = self._test_image() size_up = int(round(im.width + x)), int(round(im.height + y)) @@ -338,7 +338,7 @@ class TestImageTransformAffine: transformed = transformed.transform( im.size, self.transform, matrix_down, resample ) - assert_image_similar(transformed, im, epsilon * epsilonscale) + assert_image_similar(transformed, im, epsilon * epsilon_scale) class TestImageTransformPerspective(TestImageTransformAffine):