mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-22 15:24:37 +03:00
Merge pull request #8694 from radarhere/exceptions
This commit is contained in:
commit
84d58a0282
|
@ -7,7 +7,7 @@ import fuzzers
|
||||||
import packaging
|
import packaging
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from PIL import Image, UnidentifiedImageError, features
|
from PIL import Image, features
|
||||||
from Tests.helper import skip_unless_feature
|
from Tests.helper import skip_unless_feature
|
||||||
|
|
||||||
if sys.platform.startswith("win32"):
|
if sys.platform.startswith("win32"):
|
||||||
|
@ -32,21 +32,17 @@ def test_fuzz_images(path: str) -> None:
|
||||||
fuzzers.fuzz_image(f.read())
|
fuzzers.fuzz_image(f.read())
|
||||||
assert True
|
assert True
|
||||||
except (
|
except (
|
||||||
|
# Known exceptions from Pillow
|
||||||
OSError,
|
OSError,
|
||||||
SyntaxError,
|
SyntaxError,
|
||||||
MemoryError,
|
MemoryError,
|
||||||
ValueError,
|
ValueError,
|
||||||
NotImplementedError,
|
NotImplementedError,
|
||||||
OverflowError,
|
OverflowError,
|
||||||
):
|
# Known Image.* exceptions
|
||||||
# Known exceptions that are through from Pillow
|
|
||||||
assert True
|
|
||||||
except (
|
|
||||||
Image.DecompressionBombError,
|
Image.DecompressionBombError,
|
||||||
Image.DecompressionBombWarning,
|
Image.DecompressionBombWarning,
|
||||||
UnidentifiedImageError,
|
|
||||||
):
|
):
|
||||||
# Known Image.* exceptions
|
|
||||||
assert True
|
assert True
|
||||||
finally:
|
finally:
|
||||||
fuzzers.disable_decompressionbomb_error()
|
fuzzers.disable_decompressionbomb_error()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user