mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-13 05:06:49 +03:00
Lint fix
This commit is contained in:
parent
2f409261eb
commit
903c67353d
|
@ -775,7 +775,9 @@ class TestImage:
|
||||||
with pytest.warns(DeprecationWarning):
|
with pytest.warns(DeprecationWarning):
|
||||||
assert test_module.PILLOW_VERSION > "7.0.0"
|
assert test_module.PILLOW_VERSION > "7.0.0"
|
||||||
|
|
||||||
@pytest.mark.parametrize("path", [
|
@pytest.mark.parametrize(
|
||||||
|
"path",
|
||||||
|
[
|
||||||
"fli_overrun.bin",
|
"fli_overrun.bin",
|
||||||
"sgi_overrun.bin",
|
"sgi_overrun.bin",
|
||||||
"sgi_overrun_expandrow.bin",
|
"sgi_overrun_expandrow.bin",
|
||||||
|
@ -784,7 +786,8 @@ class TestImage:
|
||||||
"pcx_overrun2.bin",
|
"pcx_overrun2.bin",
|
||||||
"ossfuzz-4836216264589312.pcx",
|
"ossfuzz-4836216264589312.pcx",
|
||||||
"01r_00.pcx",
|
"01r_00.pcx",
|
||||||
])
|
],
|
||||||
|
)
|
||||||
def test_overrun(self, path):
|
def test_overrun(self, path):
|
||||||
"""For overrun completeness, test as:
|
"""For overrun completeness, test as:
|
||||||
valgrind pytest -qq Tests/test_image.py::TestImage::test_overrun | grep decode.c
|
valgrind pytest -qq Tests/test_image.py::TestImage::test_overrun | grep decode.c
|
||||||
|
@ -794,8 +797,10 @@ class TestImage:
|
||||||
im.load()
|
im.load()
|
||||||
assert False
|
assert False
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
assert (str(e) == "buffer overrun when reading image file" or
|
buffer_overrun = str(e) == "buffer overrun when reading image file"
|
||||||
"image file is truncated" in str(e))
|
truncated = "image file is truncated" in str(e)
|
||||||
|
|
||||||
|
assert buffer_overrun or truncated
|
||||||
|
|
||||||
def test_fli_overrun2(self):
|
def test_fli_overrun2(self):
|
||||||
with Image.open("Tests/images/fli_overrun2.bin") as im:
|
with Image.open("Tests/images/fli_overrun2.bin") as im:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user