From b236c61c04c0f6a6cc1ac24f5a56e327e890ad9c Mon Sep 17 00:00:00 2001 From: Yay295 Date: Mon, 22 Aug 2022 13:29:26 -0500 Subject: [PATCH] make @pytest.mark.parametrize annotations one line --- Tests/test_image_paste.py | 99 +++++---------------------------------- 1 file changed, 11 insertions(+), 88 deletions(-) diff --git a/Tests/test_image_paste.py b/Tests/test_image_paste.py index 0b40ba671fb..1ab02017de1 100644 --- a/Tests/test_image_paste.py +++ b/Tests/test_image_paste.py @@ -103,14 +103,7 @@ def gradient_RGBa(self): ], ) - @pytest.mark.parametrize( - "mode", - [ - "RGBA", - "RGB", - "L", - ], - ) + @pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"]) def test_image_solid(self, mode): im = Image.new(mode, (200, 200), "red") im2 = getattr(self, "gradient_" + mode) @@ -120,14 +113,7 @@ def test_image_solid(self, mode): im = im.crop((12, 23, im2.width + 12, im2.height + 23)) assert_image_equal(im, im2) - @pytest.mark.parametrize( - "mode", - [ - "RGBA", - "RGB", - "L", - ], - ) + @pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"]) def test_image_mask_1(self, mode): im = Image.new(mode, (200, 200), "white") im2 = getattr(self, "gradient_" + mode) @@ -149,14 +135,7 @@ def test_image_mask_1(self, mode): ], ) - @pytest.mark.parametrize( - "mode", - [ - "RGBA", - "RGB", - "L", - ], - ) + @pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"]) def test_image_mask_L(self, mode): im = Image.new(mode, (200, 200), "white") im2 = getattr(self, "gradient_" + mode) @@ -178,14 +157,7 @@ def test_image_mask_L(self, mode): ], ) - @pytest.mark.parametrize( - "mode", - [ - "RGBA", - "RGB", - "L", - ], - ) + @pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"]) def test_image_mask_LA(self, mode): im = Image.new(mode, (200, 200), "white") im2 = getattr(self, "gradient_" + mode) @@ -207,14 +179,7 @@ def test_image_mask_LA(self, mode): ], ) - @pytest.mark.parametrize( - "mode", - [ - "RGBA", - "RGB", - "L", - ], - ) + @pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"]) def test_image_mask_RGBA(self, mode): im = Image.new(mode, (200, 200), "white") im2 = getattr(self, "gradient_" + mode) @@ -236,14 +201,7 @@ def test_image_mask_RGBA(self, mode): ], ) - @pytest.mark.parametrize( - "mode", - [ - "RGBA", - "RGB", - "L", - ], - ) + @pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"]) def test_image_mask_RGBa(self, mode): im = Image.new(mode, (200, 200), "white") im2 = getattr(self, "gradient_" + mode) @@ -265,14 +223,7 @@ def test_image_mask_RGBa(self, mode): ], ) - @pytest.mark.parametrize( - "mode", - [ - "RGBA", - "RGB", - "L", - ], - ) + @pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"]) def test_color_solid(self, mode): im = Image.new(mode, (200, 200), "black") @@ -285,14 +236,7 @@ def test_color_solid(self, mode): assert head[255] == 128 * 128 assert sum(head[:255]) == 0 - @pytest.mark.parametrize( - "mode", - [ - "RGBA", - "RGB", - "L", - ], - ) + @pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"]) def test_color_mask_1(self, mode): im = Image.new(mode, (200, 200), (50, 60, 70, 80)[: len(mode)]) color = (10, 20, 30, 40)[: len(mode)] @@ -314,14 +258,7 @@ def test_color_mask_1(self, mode): ], ) - @pytest.mark.parametrize( - "mode", - [ - "RGBA", - "RGB", - "L", - ], - ) + @pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"]) def test_color_mask_L(self, mode): im = getattr(self, "gradient_" + mode).copy() color = "white" @@ -343,14 +280,7 @@ def test_color_mask_L(self, mode): ], ) - @pytest.mark.parametrize( - "mode", - [ - "RGBA", - "RGB", - "L", - ], - ) + @pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"]) def test_color_mask_RGBA(self, mode): im = getattr(self, "gradient_" + mode).copy() color = "white" @@ -372,14 +302,7 @@ def test_color_mask_RGBA(self, mode): ], ) - @pytest.mark.parametrize( - "mode", - [ - "RGBA", - "RGB", - "L", - ], - ) + @pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"]) def test_color_mask_RGBa(self, mode): im = getattr(self, "gradient_" + mode).copy() color = "white"