@@ -100,11 +100,11 @@ def test_sanity(self, tmp_path: Path) -> None:
100100 assert im .format == "PNG"
101101 assert im .get_format_mimetype () == "image/png"
102102
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" ]:
104104 im = hopper (mode )
105105 im .save (test_file )
106106 with Image .open (test_file ) as reloaded :
107- if mode in ( "I" , "I ;16B") :
107+ if mode == "I ;16B" :
108108 reloaded = reloaded .convert (mode )
109109 assert_image_equal (reloaded , im )
110110
@@ -801,6 +801,16 @@ def test_truncated_end_chunk(self, monkeypatch: pytest.MonkeyPatch) -> None:
801801 with Image .open ("Tests/images/truncated_end_chunk.png" ) as im :
802802 assert_image_equal_tofile (im , "Tests/images/hopper.png" )
803803
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+
804814
805815@pytest .mark .skipif (is_win32 (), reason = "Requires Unix or macOS" )
806816@skip_unless_feature ("zlib" )
0 commit comments