From f6549732570fe5648e4b1b34878f8675872976b4 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 6 Oct 2023 21:24:20 +1100 Subject: [PATCH] Test BGR;* modes --- Tests/test_lib_image.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Tests/test_lib_image.py b/Tests/test_lib_image.py index d599b625551..603de1743a7 100644 --- a/Tests/test_lib_image.py +++ b/Tests/test_lib_image.py @@ -4,7 +4,7 @@ from PIL import Image -mode_names_not_bgr = ( +mode_names = ( "1", "L", "LA", @@ -21,11 +21,9 @@ "RGBA", "RGBa", "RGBX", - # Image.frombytes() doesn't work with BGR modes: - # unknown raw mode for given image mode - # "BGR;15", - # "BGR;16", - # "BGR;24", + "BGR;15", + "BGR;16", + "BGR;24", "CMYK", "YCbCr", "HSV", @@ -62,7 +60,7 @@ def test_setmode(): im.im.setmode("RGBABCDE") -@pytest.mark.parametrize("mode", mode_names_not_bgr) +@pytest.mark.parametrize("mode", mode_names) def test_equal(mode): num_img_bytes = len(Image.new(mode, (2, 2)).tobytes()) # alternatively, random.randbytes() in Python 3.9 @@ -87,7 +85,7 @@ def test_not_equal_mode_1(): assert img_a.im != img_b.im -@pytest.mark.parametrize("mode", [mode for mode in mode_names_not_bgr if mode != "1"]) +@pytest.mark.parametrize("mode", [mode for mode in mode_names if mode != "1"]) def test_not_equal(mode): num_img_bytes = len(Image.new(mode, (2, 2)).tobytes()) # alternatively, random.randbytes() in Python 3.9