3131 is_big_endian ,
3232 is_win32 ,
3333 mark_if_feature_version ,
34- modes ,
3534 skip_unless_feature ,
3635)
3736
@@ -46,7 +45,7 @@ def helper_image_new(mode: str, size: tuple[int, int]) -> Image.Image:
4645
4746
4847class TestImage :
49- @pytest .mark .parametrize ("mode" , modes )
48+ @pytest .mark .parametrize ("mode" , Image . MODES + [ "BGR;15" , "BGR;16" , "BGR;24" ] )
5049 def test_image_modes_success (self , mode : str ) -> None :
5150 helper_image_new (mode , (1 , 1 ))
5251
@@ -1027,7 +1026,7 @@ def test_close_graceful(self, caplog: pytest.LogCaptureFixture) -> None:
10271026
10281027
10291028class TestImageBytes :
1030- @pytest .mark .parametrize ("mode" , modes )
1029+ @pytest .mark .parametrize ("mode" , Image . MODES + [ "BGR;15" , "BGR;16" , "BGR;24" ] )
10311030 def test_roundtrip_bytes_constructor (self , mode : str ) -> None :
10321031 im = hopper (mode )
10331032 source_bytes = im .tobytes ()
@@ -1039,7 +1038,7 @@ def test_roundtrip_bytes_constructor(self, mode: str) -> None:
10391038 reloaded = Image .frombytes (mode , im .size , source_bytes )
10401039 assert reloaded .tobytes () == source_bytes
10411040
1042- @pytest .mark .parametrize ("mode" , modes )
1041+ @pytest .mark .parametrize ("mode" , Image . MODES + [ "BGR;15" , "BGR;16" , "BGR;24" ] )
10431042 def test_roundtrip_bytes_method (self , mode : str ) -> None :
10441043 im = hopper (mode )
10451044 source_bytes = im .tobytes ()
@@ -1048,7 +1047,7 @@ def test_roundtrip_bytes_method(self, mode: str) -> None:
10481047 reloaded .frombytes (source_bytes )
10491048 assert reloaded .tobytes () == source_bytes
10501049
1051- @pytest .mark .parametrize ("mode" , modes )
1050+ @pytest .mark .parametrize ("mode" , Image . MODES + [ "BGR;15" , "BGR;16" , "BGR;24" ] )
10521051 def test_getdata_putdata (self , mode : str ) -> None :
10531052 if is_big_endian () and mode == "BGR;15" :
10541053 pytest .xfail ("Known failure of BGR;15 on big-endian" )
0 commit comments