Skip to content

Commit 7d37984

Browse files
committed
Test saving unsupported mode
1 parent 4469ee0 commit 7d37984

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Tests/test_file_ppm.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ def test_pfm_big_endian(tmp_path: Path) -> None:
141141
assert_image_equal_tofile(im, filename)
142142

143143

144+
def test_save_unsupported_mode(tmp_path: Path) -> None:
145+
im = hopper("P")
146+
with pytest.raises(OSError, match="cannot write mode P as PPM"):
147+
im.save(tmp_path / "out.ppm")
148+
149+
144150
@pytest.mark.parametrize(
145151
"data",
146152
[

0 commit comments

Comments
 (0)