Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 96b26fe

Browse filesBrowse files
committed
TST: Correctly skip missing distillers
When a distiller is not found, that step is simply skipped by `_try_distill`, so these tests were not actually skipped as intended.
1 parent 740c5d7 commit 96b26fe
Copy full SHA for 96b26fe

File tree

1 file changed

+12
-2
lines changed
Filter options

1 file changed

+12
-2
lines changed

‎lib/matplotlib/tests/test_backend_ps.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_backend_ps.py
+12-2Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@
4040
'eps with usetex'
4141
])
4242
def test_savefig_to_stringio(format, use_log, rcParams, orientation, papersize):
43+
if rcParams.get("ps.usedistiller") == "ghostscript":
44+
try:
45+
mpl._get_executable_info("gs")
46+
except mpl.ExecutableNotFoundError as exc:
47+
pytest.skip(str(exc))
48+
elif rcParams.get("ps.userdistiller") == "xpdf":
49+
try:
50+
mpl._get_executable_info("gs") # Effectively checks for ps2pdf.
51+
mpl._get_executable_info("pdftops")
52+
except mpl.ExecutableNotFoundError as exc:
53+
pytest.skip(str(exc))
54+
4355
mpl.rcParams.update(rcParams)
4456

4557
fig, ax = plt.subplots()
@@ -55,8 +67,6 @@ def test_savefig_to_stringio(format, use_log, rcParams, orientation, papersize):
5567
title += " \N{MINUS SIGN}\N{EURO SIGN}"
5668
ax.set_title(title)
5769
allowable_exceptions = []
58-
if rcParams.get("ps.usedistiller"):
59-
allowable_exceptions.append(mpl.ExecutableNotFoundError)
6070
if rcParams.get("text.usetex"):
6171
allowable_exceptions.append(RuntimeError)
6272
if rcParams.get("ps.useafm"):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.