From 6aa7a7edd07f928f46024f7c61bdff6a6af0417d Mon Sep 17 00:00:00 2001 From: Yay295 Date: Mon, 22 Aug 2022 13:34:47 -0500 Subject: [PATCH] auto-formatting --- Tests/test_image.py | 128 ++++++++++++++++++++++++-------------------- 1 file changed, 70 insertions(+), 58 deletions(-) diff --git a/Tests/test_image.py b/Tests/test_image.py index f28bfdfea..571ee30cc 100644 --- a/Tests/test_image.py +++ b/Tests/test_image.py @@ -531,39 +531,45 @@ class TestImage: px = im.load() assert px[0, 0] == 5 - @pytest.mark.parametrize("wrong_mode", [ - "bad", - "I;16N", - # "LAB", - "BGR;15", - "BGR;16", - "BGR;24", - "BGR;32", - ]) + @pytest.mark.parametrize( + "wrong_mode", + [ + "bad", + "I;16N", + # "LAB", + "BGR;15", + "BGR;16", + "BGR;24", + "BGR;32", + ], + ) def test_linear_gradient_wrong_mode(self, wrong_mode): with pytest.raises(ValueError): Image.linear_gradient(wrong_mode) - @pytest.mark.parametrize("mode,pixel_a,pixel_b", [ - ("1", 0, 255), - ("P", 0, 255), - ("PA", (0, 255), (255, 255)), - ("L", 0, 255), - ("LA", (0, 255), (255, 255)), - ("La", (0, 255), (255, 255)), - ("F", 0, 255), - ("I", 0, 255), - ("I;16", 0, 255), - ("I;16L", 0, 255), - ("I;16B", 0, 255), - ("RGB", (0, 0, 0), (255, 255, 255)), - ("RGBX", (0, 0, 0, 255), (255, 255, 255, 255)), - ("RGBA", (0, 0, 0, 255), (255, 255, 255, 255)), - ("RGBa", (0, 0, 0, 255), (255, 255, 255, 255)), - ("CMYK", (0, 0, 0, 255), (0, 0, 0, 0)), - ("YCbCr", (0, 128, 128), (255, 128, 128)), - ("HSV", (0, 0, 0), (0, 0, 255)), - ]) + @pytest.mark.parametrize( + "mode,pixel_a,pixel_b", + [ + ("1", 0, 255), + ("P", 0, 255), + ("PA", (0, 255), (255, 255)), + ("L", 0, 255), + ("LA", (0, 255), (255, 255)), + ("La", (0, 255), (255, 255)), + ("F", 0, 255), + ("I", 0, 255), + ("I;16", 0, 255), + ("I;16L", 0, 255), + ("I;16B", 0, 255), + ("RGB", (0, 0, 0), (255, 255, 255)), + ("RGBX", (0, 0, 0, 255), (255, 255, 255, 255)), + ("RGBA", (0, 0, 0, 255), (255, 255, 255, 255)), + ("RGBa", (0, 0, 0, 255), (255, 255, 255, 255)), + ("CMYK", (0, 0, 0, 255), (0, 0, 0, 0)), + ("YCbCr", (0, 128, 128), (255, 128, 128)), + ("HSV", (0, 0, 0), (0, 0, 255)), + ], + ) def test_linear_gradient(self, mode, pixel_a, pixel_b): # Arrange target_file = "Tests/images/linear_gradient.png" @@ -580,39 +586,45 @@ class TestImage: target = target.convert(mode, dither=0) assert_image_equal(im, target) - @pytest.mark.parametrize("wrong_mode", [ - "bad", - "I;16N", - # "LAB", - "BGR;15", - "BGR;16", - "BGR;24", - "BGR;32", - ]) + @pytest.mark.parametrize( + "wrong_mode", + [ + "bad", + "I;16N", + # "LAB", + "BGR;15", + "BGR;16", + "BGR;24", + "BGR;32", + ], + ) def test_radial_gradient_wrong_mode(self, wrong_mode): with pytest.raises(ValueError): Image.radial_gradient(wrong_mode) - @pytest.mark.parametrize("mode,pixel_a,pixel_b", [ - ("1", 255, 0), - ("P", 255, 0), - ("PA", (255, 255), (0, 255)), - ("L", 255, 0), - ("LA", (255, 255), (0, 255)), - ("La", (255, 255), (0, 255)), - ("F", 255, 0), - ("I", 255, 0), - ("I;16", 255, 0), - ("I;16L", 255, 0), - ("I;16B", 255, 0), - ("RGB", (255, 255, 255), (0, 0, 0)), - ("RGBX", (255, 255, 255, 255), (0, 0, 0, 255)), - ("RGBA", (255, 255, 255, 255), (0, 0, 0, 255)), - ("RGBa", (255, 255, 255, 255), (0, 0, 0, 255)), - ("CMYK", (0, 0, 0, 0), (0, 0, 0, 255)), - ("YCbCr", (255, 128, 128), (0, 128, 128)), - ("HSV", (0, 0, 255), (0, 0, 0)), - ]) + @pytest.mark.parametrize( + "mode,pixel_a,pixel_b", + [ + ("1", 255, 0), + ("P", 255, 0), + ("PA", (255, 255), (0, 255)), + ("L", 255, 0), + ("LA", (255, 255), (0, 255)), + ("La", (255, 255), (0, 255)), + ("F", 255, 0), + ("I", 255, 0), + ("I;16", 255, 0), + ("I;16L", 255, 0), + ("I;16B", 255, 0), + ("RGB", (255, 255, 255), (0, 0, 0)), + ("RGBX", (255, 255, 255, 255), (0, 0, 0, 255)), + ("RGBA", (255, 255, 255, 255), (0, 0, 0, 255)), + ("RGBa", (255, 255, 255, 255), (0, 0, 0, 255)), + ("CMYK", (0, 0, 0, 0), (0, 0, 0, 255)), + ("YCbCr", (255, 128, 128), (0, 128, 128)), + ("HSV", (0, 0, 255), (0, 0, 0)), + ], + ) def test_radial_gradient(self, mode, pixel_a, pixel_b): # Arrange target_file = "Tests/images/radial_gradient.png"