From 44096adf59938637a535766d586e00b1a35b7ff3 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 1 Apr 2020 10:19:15 +0300 Subject: [PATCH] Convert from unittest to pytest --- Tests/test_sgi_crash.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/Tests/test_sgi_crash.py b/Tests/test_sgi_crash.py index c8917df4d5c..6f3fc6f5d13 100644 --- a/Tests/test_sgi_crash.py +++ b/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()