From 00b25fd3ac3648bc28eff5d4c4d816e605e3f05f Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Fri, 28 Oct 2022 18:02:24 +0300 Subject: [PATCH] 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> --- Tests/test_file_tiff.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tests/test_file_tiff.py b/Tests/test_file_tiff.py index 752c1e61ed1..5953dfa1814 100644 --- a/Tests/test_file_tiff.py +++ b/Tests/test_file_tiff.py @@ -867,8 +867,9 @@ def test_timeout(self): @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