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):
194194 if compare is None :
195195 return
196196
197- from PIL import Image
198197 import matplotlib
198+ from matplotlib .image import imread
199199 import matplotlib .pyplot as plt
200200 from matplotlib .testing .compare import compare_images
201201 try :
@@ -291,8 +291,8 @@ def item_function_wrapper(*args, **kwargs):
291291 # Compare image size ourselves since the Matplotlib
292292 # exception is a bit cryptic in this case and doesn't show
293293 # 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 ]
296296 if expected_shape != actual_shape :
297297 error = SHAPE_MISMATCH_ERROR .format (expected_path = baseline_image ,
298298 expected_shape = expected_shape ,
You can’t perform that action at this time.
0 commit comments