mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 09:26:16 +03:00
Convert from unittest to pytest
This commit is contained in:
parent
78478dfcfb
commit
44096adf59
|
@ -1,18 +1,14 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
import pytest
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
from .helper import PillowTestCase
|
|
||||||
|
|
||||||
repro = (
|
@pytest.mark.parametrize(
|
||||||
"Tests/images/sgi_overrun_expandrowF04.bin",
|
"test_file",
|
||||||
"Tests/images/sgi_crash.bin",
|
["Tests/images/sgi_overrun_expandrowF04.bin", "Tests/images/sgi_crash.bin"],
|
||||||
)
|
)
|
||||||
|
def test_crashes(test_file):
|
||||||
|
with open(test_file, "rb") as f:
|
||||||
class TestSgiCrashes(PillowTestCase):
|
|
||||||
def test_crashes(self):
|
|
||||||
for path in repro:
|
|
||||||
with open(path, "rb") as f:
|
|
||||||
im = Image.open(f)
|
im = Image.open(f)
|
||||||
with self.assertRaises(IOError):
|
with pytest.raises(IOError):
|
||||||
im.load()
|
im.load()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user