|
9 | 9 | import numpy as np |
10 | 10 | from numpy.testing import assert_array_equal |
11 | 11 |
|
12 | | -from matplotlib.testing.decorators import (image_comparison, |
13 | | - knownfailureif, cleanup) |
| 12 | +from matplotlib.testing.decorators import image_comparison, cleanup |
14 | 13 | from matplotlib.image import (AxesImage, BboxImage, FigureImage, |
15 | 14 | NonUniformImage, PcolorImage) |
16 | 15 | from matplotlib.transforms import Bbox, Affine2D, TransformedBbox |
|
31 | 30 | HAS_PIL = True |
32 | 31 | except ImportError: |
33 | 32 | HAS_PIL = False |
| 33 | +needs_pillow = pytest.mark.xfail(not HAS_PIL, reason='Test requires Pillow') |
34 | 34 |
|
35 | 35 |
|
36 | 36 | @image_comparison(baseline_images=['image_interps']) |
@@ -101,7 +101,7 @@ def test_image_python_io(): |
101 | 101 | plt.imread(buffer) |
102 | 102 |
|
103 | 103 |
|
104 | | -@knownfailureif(not HAS_PIL) |
| 104 | +@needs_pillow |
105 | 105 | def test_imread_pil_uint16(): |
106 | 106 | img = plt.imread(os.path.join(os.path.dirname(__file__), |
107 | 107 | 'baseline_images', 'test_image', 'uint16.tif')) |
@@ -480,7 +480,7 @@ def test_nonuniformimage_setnorm(): |
480 | 480 | im.set_norm(plt.Normalize()) |
481 | 481 |
|
482 | 482 |
|
483 | | -@knownfailureif(not HAS_PIL) |
| 483 | +@needs_pillow |
484 | 484 | @cleanup |
485 | 485 | def test_jpeg_alpha(): |
486 | 486 | plt.figure(figsize=(1, 1), dpi=300) |
|
0 commit comments