From c7e3158d515fe339f67e1b0313105ae9b88efa42 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 21 Mar 2025 20:47:38 +1100 Subject: [PATCH] Added explicit test for opening and saving image with string --- Tests/test_image.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Tests/test_image.py b/Tests/test_image.py index d13e47602..f18d8489c 100644 --- a/Tests/test_image.py +++ b/Tests/test_image.py @@ -175,6 +175,13 @@ class TestImage: with Image.open(io.StringIO()): # type: ignore[arg-type] pass + def test_string(self, tmp_path: Path) -> None: + out = str(tmp_path / "temp.png") + im = hopper() + im.save(out) + with Image.open(out) as reloaded: + assert_image_equal(im, reloaded) + def test_pathlib(self, tmp_path: Path) -> None: with Image.open(Path("Tests/images/multipage-mmap.tiff")) as im: assert im.mode == "P"