8000 Merge pull request #23832 from timhoffm/better-error · matplotlib/matplotlib@1fe8792 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1fe8792

Browse files
authored
Merge pull request #23832 from timhoffm/better-error
Improve skip message for image comparison tests
2 parents 97b9577 + 1a35dd0 commit 1fe8792

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/matplotlib/testing/decorators.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,12 @@ def wrapper(*args, extension, request, **kwargs):
264264
kwargs['request'] = request
265265

266266
if extension not in comparable_formats():
267-
pytest.skip(f"Cannot compare {extension} files on this system")
267+
reason = {
268+
'pdf': 'because Ghostscript is not installed',
269+
'eps': 'because Ghostscript is not installed',
270+
'svg': 'because Inkscape is not installed',
271+
}.get(extension, 'on this system')
272+
pytest.skip(f"Cannot compare {extension} files {reason}")
268273

269274
img = _ImageComparisonBase(func, tol=tol, remove_text=remove_text,
270275
savefig_kwargs=savefig_kwargs)

0 commit comments

Comments
 (0)
0