Skip to content

Commit 5e91231

Browse files
authored
Update tests to check for ValueError when encoding an empty image (#9464)
2 parents 8004234 + dd042da commit 5e91231

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Tests/test_file_gif.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def test_roundtrip_save_all_1(tmp_path: Path) -> None:
314314
def test_save_zero(size: tuple[int, int]) -> None:
315315
b = BytesIO()
316316
im = Image.new("RGB", size)
317-
with pytest.raises(SystemError):
317+
with pytest.raises(ValueError, match="cannot write empty image"):
318318
im.save(b, "GIF")
319319

320320

Tests/test_file_spider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def test_save(tmp_path: Path) -> None:
7272
def test_save_zero(size: tuple[int, int]) -> None:
7373
b = BytesIO()
7474
im = Image.new("1", size)
75-
with pytest.raises(SystemError):
75+
with pytest.raises(ValueError, match="cannot write empty image"):
7676
im.save(b, "SPIDER")
7777

7878

0 commit comments

Comments
 (0)