Added test

This commit is contained in:
Andrew Murray 2024-06-25 21:38:47 +10:00 committed by Yay295
parent 58d5a73fac
commit 88b21e7254
2 changed files with 6 additions and 0 deletions

Binary file not shown.

View File

@ -335,6 +335,12 @@ def test_issue_6194() -> None:
assert im.getpixel((5, 5)) == 31
def test_unknown_j2k_mode() -> None:
with pytest.raises(UnidentifiedImageError):
with Image.open("Tests/images/unknown_mode.j2k"):
pass
def test_unbound_local() -> None:
# prepatch, a malformed jp2 file could cause an UnboundLocalError exception.
with pytest.raises(OSError):