From 0af193afc0a66545667b651444256234f63ad1fe Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 4 Aug 2020 21:58:03 +1000 Subject: [PATCH] Added test --- Tests/test_imagefile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tests/test_imagefile.py b/Tests/test_imagefile.py index e0dbd909a..b4107e8e3 100644 --- a/Tests/test_imagefile.py +++ b/Tests/test_imagefile.py @@ -244,3 +244,8 @@ class TestPyDecoder: im = MockImageFile(buf) assert im.format is None assert im.get_format_mimetype() is None + + def test_oserror(self): + im = Image.new("RGB", (1, 1)) + with pytest.raises(OSError): + im.save(BytesIO(), "JPEG2000")