8000 Merge pull request #8096 from anntzer/improve-imagecomparisondecorato… · matplotlib/matplotlib@5f98750 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5f98750

Browse files
authored
Merge pull request #8096 from anntzer/improve-imagecomparisondecorator-error-message
Improve error message for image_comparison decorator.
2 parents 5e825bd + 224305c commit 5f98750

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/matplotlib/testing/decorators.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ def __init__(self, baseline_images, extensions, tol,
245245
self.style = style
246246

247247
def delayed_init(self, func):
248-
assert callable(func), "func must be callable"
249248
assert self.func is None, "it looks like same decorator used twice"
250249
self.func = func
251250
self.baseline_dir, self.result_dir = _image_directories(func)
@@ -258,8 +257,8 @@ def setup(self):
258257
matplotlib.testing.set_font_settings_for_testing()
259258
func()
260259
assert len(plt.get_fignums()) == len(self.baseline_images), (
261-
'Figures and baseline_images count are not the same'
262-
' (`%s`)' % getattr(func, '__qualname__', func.__name__))
260+
"Test generated {} images but there are {} baseline images"
261+
.format(len(plt.get_fignums()), len(self.baseline_images)))
263262
except:
264263
# Restore original settings before raising errors during the update.
265264
self.teardown_class()

0 commit comments

Comments
 (0)
0