Parametrized test

This commit is contained in:
Andrew Murray 2023-07-22 20:00:42 +10:00
parent ea0abb94cc
commit 26ca569cbe

View File

@ -274,17 +274,15 @@ def test_sgnd(tmp_path):
assert reloaded_signed.getpixel((0, 0)) == 128 assert reloaded_signed.getpixel((0, 0)) == 128
def test_rgba(): @pytest.mark.parametrize("ext", (".j2k", ".jp2"))
def test_rgba(ext):
# Arrange # Arrange
with Image.open("Tests/images/rgb_trns_ycbc.j2k") as j2k: with Image.open("Tests/images/rgb_trns_ycbc" + ext) as im:
with Image.open("Tests/images/rgb_trns_ycbc.jp2") as jp2:
# Act # Act
j2k.load() im.load()
jp2.load()
# Assert # Assert
assert j2k.mode == "RGBA" assert im.mode == "RGBA"
assert jp2.mode == "RGBA"
@pytest.mark.parametrize("ext", (".j2k", ".jp2")) @pytest.mark.parametrize("ext", (".j2k", ".jp2"))