Skip to content

Commit

Permalink
Convert from unittest to pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Apr 1, 2020
1 parent 78478df commit 44096ad
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions Tests/test_sgi_crash.py
@@ -1,18 +1,14 @@
#!/usr/bin/env python
import pytest
from PIL import Image

from .helper import PillowTestCase

repro = (
"Tests/images/sgi_overrun_expandrowF04.bin",
"Tests/images/sgi_crash.bin",
@pytest.mark.parametrize(
"test_file",
["Tests/images/sgi_overrun_expandrowF04.bin", "Tests/images/sgi_crash.bin"],
)


class TestSgiCrashes(PillowTestCase):
def test_crashes(self):
for path in repro:
with open(path, "rb") as f:
im = Image.open(f)
with self.assertRaises(IOError):
im.load()
def test_crashes(test_file):
with open(test_file, "rb") as f:
im = Image.open(f)
with pytest.raises(IOError):
im.load()

0 comments on commit 44096ad

Please sign in to comment.