Parametrized test

This commit is contained in:
Andrew Murray 2020-05-26 07:15:20 +10:00
parent 660894cd36
commit 696aa7972d

View File

@ -90,9 +90,10 @@ class TestFileJpeg:
] ]
assert k > 0.9 assert k > 0.9
def test_dpi(self): @pytest.mark.parametrize(
for test_image_path in [TEST_FILE, "Tests/images/pil_sample_cmyk.jpg"]: "test_image_path", [TEST_FILE, "Tests/images/pil_sample_cmyk.jpg"],
)
def test_dpi(self, test_image_path):
def test(xdpi, ydpi=None): def test(xdpi, ydpi=None):
with Image.open(test_image_path) as im: with Image.open(test_image_path) as im:
im = self.roundtrip(im, dpi=(xdpi, ydpi or xdpi)) im = self.roundtrip(im, dpi=(xdpi, ydpi or xdpi))