Skip to content

Commit c7e3158

Browse files
committed
Added explicit test for opening and saving image with string
1 parent 9334bf0 commit c7e3158

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Tests/test_image.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,13 @@ def test_stringio(self) -> None:
175175
with Image.open(io.StringIO()): # type: ignore[arg-type]
176176
pass
177177

178+
def test_string(self, tmp_path: Path) -> None:
179+
out = str(tmp_path / "temp.png")
180+
im = hopper()
181+
im.save(out)
182+
with Image.open(out) as reloaded:
183+
assert_image_equal(im, reloaded)
184+
178185
def test_pathlib(self, tmp_path: Path) -> None:
179186
with Image.open(Path("Tests/images/multipage-mmap.tiff")) as im:
180187
assert im.mode == "P"

0 commit comments

Comments
 (0)