Skip to content

TST: Skip webp tests if it isn't available #28788

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

Merged
merged 1 commit into from
Sep 9, 2024
Merged
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
4 changes: 3 additions & 1 deletion lib/matplotlib/tests/test_agg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
from numpy.testing import assert_array_almost_equal
from PIL import Image, TiffTags
from PIL import features, Image, TiffTags
import pytest


Expand Down Expand Up @@ -249,6 +249,7 @@ def test_pil_kwargs_tiff():
assert tags["ImageDescription"] == "test image"


@pytest.mark.skipif(not features.check("webp"), reason="WebP support not available")
def test_pil_kwargs_webp():
plt.plot([0, 1, 2], [0, 1, 0])
buf_small = io.BytesIO()
Expand All @@ -262,6 +263,7 @@ def test_pil_kwargs_webp():
assert buf_large.getbuffer().nbytes > buf_small.getbuffer().nbytes


@pytest.mark.skipif(not features.check("webp"), reason="WebP support not available")
def test_webp_alpha():
plt.plot([0, 1, 2], [0, 1, 0])
buf = io.BytesIO()
Expand Down
Loading