Skip to content

Commit 234f08a

Browse files
authored
Merge pull request #28788 from greglucas/webp-test-skip
TST: Skip webp tests if it isn't available
2 parents 5461ae2 + a809c64 commit 234f08a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/tests/test_agg.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import numpy as np
44
from numpy.testing import assert_array_almost_equal
5-
from PIL import Image, TiffTags
5+
from PIL import features, Image, TiffTags
66
import pytest
77

88

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

251251

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

264265

266+
@pytest.mark.skipif(not features.check("webp"), reason="WebP support not available")
265267
def test_webp_alpha():
266268
plt.plot([0, 1, 2], [0, 1, 0])
267269
buf = io.BytesIO()

0 commit comments

Comments
 (0)