Skip to content

Commit

Permalink
adjusted tests for 1.18.0 libheif (#267)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Piskun <[email protected]>
  • Loading branch information
bigcat88 authored Jul 16, 2024
1 parent 3540b5d commit a59434e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 4 additions & 7 deletions tests/basic_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@ def test_libheif_info():
info = pillow_heif.libheif_info()
for key in ("HEIF", "AVIF", "encoders", "decoders"):
assert key in info
assert pillow_heif.libheif_version() in (
"1.17.1",
"1.17.3",
"1.17.4",
"1.17.5",
"1.17.6",
)

version = pillow_heif.libheif_version()
valid_prefixes = ["1.17.", "1.18."]
assert any(version.startswith(prefix) for prefix in valid_prefixes)


@pytest.mark.skipif(helpers.aom(), reason="Only when AVIF support missing.")
Expand Down
4 changes: 2 additions & 2 deletions tests/read_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ def test_heif_corrupted_open(img_path):
@pytest.mark.parametrize("img_path", dataset.CORRUPTED_DATASET)
def test_pillow_corrupted_open(img_path):
for input_type in [BytesIO(img_path.read_bytes()), img_path, builtins.open(img_path, "rb")]:
with pytest.raises(UnidentifiedImageError):
Image.open(input_type)
with pytest.raises((UnidentifiedImageError, ValueError)):
Image.open(input_type).load()


def test_heif_image_order():
Expand Down

0 comments on commit a59434e

Please sign in to comment.