8000 TST: Correctly skip missing distillers · melissawm/matplotlib@96b26fe · GitHub
[go: up one dir, main page]

Skip to content

Commit 96b26fe

Browse 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

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lib/matplotlib/tests/test_backend_ps.py

Lines 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