From 5eee081e901bc051293e341c0c4168258f6c459d Mon Sep 17 00:00:00 2001 From: Yay295 Date: Sat, 10 Jun 2023 21:23:46 -0500 Subject: [PATCH] autosize TestImageBytes.sample_bytes --- Tests/test_image.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Tests/test_image.py b/Tests/test_image.py index 2288bd979e5..ba5b5c0edbc 100644 --- a/Tests/test_image.py +++ b/Tests/test_image.py @@ -1047,8 +1047,11 @@ class TestImageBytes: name for name, num_bands, pixelsize in image_modes if "BGR" not in name ] - # make this bigger if necessary - sample_bytes = bytes(range(16)) + sample_bytes = bytes( + range( + 2 * 2 * max(pixelsize for mode, num_bands, pixelsize in image_modes_not_bgr) + ) + ) @pytest.mark.parametrize("mode", image_mode_names_not_bgr) def test_roundtrip_bytes_constructor(self, mode):