Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjusted tests for 1.18.0 libheif #267

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading