Skip to content

Commit 3c5324b

Browse files
authored
Merge pull request #7300 from radarhere/test
Parametrized test
2 parents 06e66f7 + 26ca569 commit 3c5324b

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

Tests/test_file_jpeg2k.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -274,17 +274,15 @@ def test_sgnd(tmp_path):
274274
assert reloaded_signed.getpixel((0, 0)) == 128
275275

276276

277-
def test_rgba():
277+
@pytest.mark.parametrize("ext", (".j2k", ".jp2"))
278+
def test_rgba(ext):
278279
# Arrange
279-
with Image.open("Tests/images/rgb_trns_ycbc.j2k") as j2k:
280-
with Image.open("Tests/images/rgb_trns_ycbc.jp2") as jp2:
281-
# Act
282-
j2k.load()
283-
jp2.load()
284-
285-
# Assert
286-
assert j2k.mode == "RGBA"
287-
assert jp2.mode == "RGBA"
280+
with Image.open("Tests/images/rgb_trns_ycbc" + ext) as im:
281+
# Act
282+
im.load()
283+
284+
# Assert
285+
assert im.mode == "RGBA"
288286

289287

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

0 commit comments

Comments
 (0)