File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -194,8 +194,8 @@ def pytest_runtest_setup(self, item):
194
194
if compare is None :
195
195
return
196
196
197
- from PIL import Image
198
197
import matplotlib
198
+ from matplotlib .image import imread
199
199
import matplotlib .pyplot as plt
200
200
from matplotlib .testing .compare import compare_images
201
201
try :
@@ -291,8 +291,8 @@ def item_function_wrapper(*args, **kwargs):
291
291
# Compare image size ourselves since the Matplotlib
292
292
# exception is a bit cryptic in this case and doesn't show
293
293
# the filenames
294
- expected_shape = Image . open (baseline_image ).size
295
- actual_shape = Image . open (test_image ).size
294
+ expected_shape = imread (baseline_image ).shape [: 2 ]
295
+ actual_shape = imread (test_image ).shape [: 2 ]
296
296
if expected_shape != actual_shape :
297
297
error = SHAPE_MISMATCH_ERROR .format (expected_path = baseline_image ,
298
298
expected_shape = expected_shape ,
You can’t perform that action at this time.
0 commit comments