Skip to content

Commit

Permalink
Merge pull request #7300 from radarhere/test
Browse files Browse the repository at this point in the history
Parametrized test
  • Loading branch information
hugovk committed Jul 23, 2023
2 parents 06e66f7 + 26ca569 commit 3c5324b
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Tests/test_file_jpeg2k.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
# Act
j2k.load()
jp2.load()

# Assert
assert j2k.mode == "RGBA"
assert jp2.mode == "RGBA"
with Image.open("Tests/images/rgb_trns_ycbc" + ext) as im:
# Act
im.load()

# Assert
assert im.mode == "RGBA"


@pytest.mark.parametrize("ext", (".j2k", ".jp2"))
Expand Down

0 comments on commit 3c5324b

Please sign in to comment.