Skip to content

Commit a59434e

Browse files
authored
adjusted tests for 1.18.0 libheif (#267)
Signed-off-by: Alexander Piskun <[email protected]>
1 parent 3540b5d commit a59434e

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

tests/basic_test.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,10 @@ def test_libheif_info():
1515
info = pillow_heif.libheif_info()
1616
for key in ("HEIF", "AVIF", "encoders", "decoders"):
1717
assert key in info
18-
assert pillow_heif.libheif_version() in (
19-
"1.17.1",
20-
"1.17.3",
21-
"1.17.4",
22-
"1.17.5",
23-
"1.17.6",
24-
)
18+
19+
version = pillow_heif.libheif_version()
20+
valid_prefixes = ["1.17.", "1.18."]
21+
assert any(version.startswith(prefix) for prefix in valid_prefixes)
2522

2623

2724
@pytest.mark.skipif(helpers.aom(), reason="Only when AVIF support missing.")

tests/read_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ def test_heif_corrupted_open(img_path):
9999
@pytest.mark.parametrize("img_path", dataset.CORRUPTED_DATASET)
100100
def test_pillow_corrupted_open(img_path):
101101
for input_type in [BytesIO(img_path.read_bytes()), img_path, builtins.open(img_path, "rb")]:
102-
with pytest.raises(UnidentifiedImageError):
103-
Image.open(input_type)
102+
with pytest.raises((UnidentifiedImageError, ValueError)):
103+
Image.open(input_type).load()
104104

105105

106106
def test_heif_image_order():

0 commit comments

Comments
 (0)