mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-03 13:14:27 +03:00
Replaced OSError with more specific UnidentifiedImageError
This commit is contained in:
parent
3e9068a345
commit
abbc890b20
|
@ -3,7 +3,7 @@ import re
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from PIL import ExifTags, Image, ImageFile, JpegImagePlugin
|
from PIL import ExifTags, Image, ImageFile, JpegImagePlugin, UnidentifiedImageError
|
||||||
|
|
||||||
from .helper import (
|
from .helper import (
|
||||||
assert_image,
|
assert_image,
|
||||||
|
@ -718,7 +718,7 @@ class TestFileJpeg:
|
||||||
return res
|
return res
|
||||||
|
|
||||||
buffer.read = read
|
buffer.read = read
|
||||||
with pytest.raises(OSError):
|
with pytest.raises(UnidentifiedImageError):
|
||||||
Image.open(buffer)
|
Image.open(buffer)
|
||||||
|
|
||||||
# Assert the entire file has not been read
|
# Assert the entire file has not been read
|
||||||
|
|
Loading…
Reference in New Issue
Block a user