Convert from unittest to pytest

This commit is contained in:
Hugo 2020-04-01 10:19:15 +03:00
parent 78478dfcfb
commit 44096adf59

View File

@ -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:
def test_crashes(test_file):
with open(test_file, "rb") as f:
im = Image.open(f)
with self.assertRaises(IOError):
with pytest.raises(IOError):
im.load()