@@ -100,11 +100,11 @@ def test_sanity(self, tmp_path: Path) -> None:
100
100
assert im .format == "PNG"
101
101
assert im .get_format_mimetype () == "image/png"
102
102
103
- for mode in ["1" , "L" , "P" , "RGB" , "I" , "I ;16" , "I;16B" ]:
103
+ for mode in ["1" , "L" , "P" , "RGB" , "I;16" , "I;16B" ]:
104
104
im = hopper (mode )
105
105
im .save (test_file )
106
106
with Image .open (test_file ) as reloaded :
107
- if mode in ( "I" , "I ;16B") :
107
+ if mode == "I ;16B" :
108
108
reloaded = reloaded .convert (mode )
109
109
assert_image_equal (reloaded , im )
110
110
@@ -801,6 +801,16 @@ def test_truncated_end_chunk(self, monkeypatch: pytest.MonkeyPatch) -> None:
801
801
with Image .open ("Tests/images/truncated_end_chunk.png" ) as im :
802
802
assert_image_equal_tofile (im , "Tests/images/hopper.png" )
803
803
804
+ def test_deprecation (self , tmp_path : Path ) -> None :
805
+ test_file = tmp_path / "out.png"
806
+
807
+ im = hopper ("I" )
808
+ with pytest .warns (DeprecationWarning ):
809
+ im .save (test_file )
810
+
811
+ with Image .open (test_file ) as reloaded :
812
+ assert_image_equal (im , reloaded .convert ("I" ))
813
+
804
814
805
815
@pytest .mark .skipif (is_win32 (), reason = "Requires Unix or macOS" )
806
816
@skip_unless_feature ("zlib" )
0 commit comments