Skip to content

Commit 44096ad

Browse files
committed
Convert from unittest to pytest
1 parent 78478df commit 44096ad

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

Tests/test_sgi_crash.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
#!/usr/bin/env python
2+
import pytest
23
from PIL import Image
34

4-
from .helper import PillowTestCase
55

6-
repro = (
7-
"Tests/images/sgi_overrun_expandrowF04.bin",
8-
"Tests/images/sgi_crash.bin",
6+
@pytest.mark.parametrize(
7+
"test_file",
8+
["Tests/images/sgi_overrun_expandrowF04.bin", "Tests/images/sgi_crash.bin"],
99
)
10-
11-
12-
class TestSgiCrashes(PillowTestCase):
13-
def test_crashes(self):
14-
for path in repro:
15-
with open(path, "rb") as f:
16-
im = Image.open(f)
17-
with self.assertRaises(IOError):
18-
im.load()
10+
def test_crashes(test_file):
11+
with open(test_file, "rb") as f:
12+
im = Image.open(f)
13+
with pytest.raises(IOError):
14+
im.load()

0 commit comments

Comments
 (0)