Hide UserWarning in logs

Tests/test_file_tiff.py::TestFileTiff::test_oom[Tests/images/oom-225817ca0f8c663be7ab4b9e717b02c661e66834.tif]
  PIL/TiffImagePlugin.py:850: UserWarning: Corrupt EXIF data.  Expecting to read 12 bytes but only got 6. 
    warnings.warn(str(msg))

Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
Hugo van Kemenade 2022-10-28 18:02:24 +03:00
parent 05b175ef88
commit 00b25fd3ac

View File

@ -867,8 +867,9 @@ class TestFileTiff:
@pytest.mark.timeout(2)
def test_oom(self, test_file):
with pytest.raises(UnidentifiedImageError):
with Image.open(test_file) as im:
pass
with pytest.warns(UserWarning):
with Image.open(test_file) as im:
pass