mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-21 20:54:47 +03:00
Update test to check for filename in exception info.
This commit is contained in:
parent
c3373e928c
commit
79d1068ca6
|
@ -120,12 +120,14 @@ class TestImageFile:
|
||||||
@skip_unless_feature("zlib")
|
@skip_unless_feature("zlib")
|
||||||
def test_truncated_with_errors(self):
|
def test_truncated_with_errors(self):
|
||||||
with Image.open("Tests/images/truncated_image.png") as im:
|
with Image.open("Tests/images/truncated_image.png") as im:
|
||||||
with pytest.raises(OSError):
|
with pytest.raises(OSError) as oseinfo:
|
||||||
im.load()
|
im.load()
|
||||||
|
assert "Tests/images/truncated_image.png" in str(oseinfo.value)
|
||||||
|
|
||||||
# Test that the error is raised if loaded a second time
|
# Test that the error is raised if loaded a second time
|
||||||
with pytest.raises(OSError):
|
with pytest.raises(OSError) as oseinfo:
|
||||||
im.load()
|
im.load()
|
||||||
|
assert "Tests/images/truncated_image.png" in str(oseinfo.value)
|
||||||
|
|
||||||
@skip_unless_feature("zlib")
|
@skip_unless_feature("zlib")
|
||||||
def test_truncated_without_errors(self):
|
def test_truncated_without_errors(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user