mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-24 17:06:16 +03:00
suppress and check warning during tests
This commit is contained in:
parent
9930b05a33
commit
0f87b1f125
|
@ -370,7 +370,8 @@ class TestFileJpeg(PillowTestCase):
|
|||
|
||||
# Act
|
||||
# Shouldn't raise error
|
||||
im = Image.open("Tests/images/sugarshack_bad_mpo_header.jpg")
|
||||
fn = "Tests/images/sugarshack_bad_mpo_header.jpg"
|
||||
im = self.assert_warning(UserWarning, lambda: Image.open(fn))
|
||||
|
||||
# Assert
|
||||
self.assertEqual(im.format, "JPEG")
|
||||
|
|
|
@ -103,8 +103,9 @@ class TestFileTiff(PillowTestCase):
|
|||
lambda: TiffImagePlugin.TiffImageFile(invalid_file))
|
||||
|
||||
def test_bad_exif(self):
|
||||
i = Image.open('Tests/images/hopper_bad_exif.jpg')
|
||||
try:
|
||||
Image.open('Tests/images/hopper_bad_exif.jpg')._getexif()
|
||||
self.assert_warning(UserWarning, lambda: i._getexif())
|
||||
except struct.error:
|
||||
self.fail(
|
||||
"Bad EXIF data passed incorrect values to _binary unpack")
|
||||
|
|
Loading…
Reference in New Issue
Block a user