Skip to content

Commit

Permalink
Lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jan 2, 2021
1 parent 2f40926 commit 903c673
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Tests/test_image.py
Expand Up @@ -775,7 +775,9 @@ def test_pillow_version(self, test_module):
with pytest.warns(DeprecationWarning):
assert test_module.PILLOW_VERSION > "7.0.0"

@pytest.mark.parametrize("path", [
@pytest.mark.parametrize(
"path",
[
"fli_overrun.bin",
"sgi_overrun.bin",
"sgi_overrun_expandrow.bin",
Expand All @@ -784,7 +786,8 @@ def test_pillow_version(self, test_module):
"pcx_overrun2.bin",
"ossfuzz-4836216264589312.pcx",
"01r_00.pcx",
])
],
)
def test_overrun(self, path):
"""For overrun completeness, test as:
valgrind pytest -qq Tests/test_image.py::TestImage::test_overrun | grep decode.c
Expand All @@ -794,8 +797,10 @@ def test_overrun(self, path):
im.load()
assert False
except OSError as e:
assert (str(e) == "buffer overrun when reading image file" or
"image file is truncated" in str(e))
buffer_overrun = str(e) == "buffer overrun when reading image file"
truncated = "image file is truncated" in str(e)

assert buffer_overrun or truncated

def test_fli_overrun2(self):
with Image.open("Tests/images/fli_overrun2.bin") as im:
Expand Down

0 comments on commit 903c673

Please sign in to comment.