Merge pull request #7300 from radarhere/test

Parametrized test
This commit is contained in:
Hugo van Kemenade 2023-07-23 09:12:40 +02:00 committed by GitHub
commit 3c5324b07c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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