Skip to content

Commit c42441a

Browse files
committed
Merge pull request #945 from mdboom/test-without-pil
Make PIL-specific test as knownfailure if PIL is not installed.
2 parents 3de7046 + bf38f8b commit c42441a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/matplotlib/tests/test_image.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
import io
1111
import os
1212

13+
try:
14+
from PIL import Image
15+
HAS_PIL = True
16+
except ImportError:
17+
HAS_PIL = False
18+
1319
@image_comparison(baseline_images=['image_interps'])
1420
def test_image_interps():
1521
'make the basic nearest, bilinear and bicubic interps'
@@ -76,9 +82,10 @@ def test_image_python_io():
7682
buffer.seek(0)
7783
plt.imread(buffer)
7884

85+
@knownfailureif(not HAS_PIL)
7986
def test_imread_pil_uint16():
8087
img = plt.imread(os.path.join(os.path.dirname(__file__),
81-
'baseline_images/test_image/uint16.tif'))
88+
'baseline_images', 'test_image', 'uint16.tif'))
8289
assert (img.dtype == np.uint16)
8390
assert np.sum(img) == 134184960
8491

0 commit comments

Comments
 (0)