8000 Add a smoketest for ps.usedistiller="xpdf". · matplotlib/matplotlib@2c5ed1c · GitHub
[go: up one dir, main page]

Skip to content

Commit 2c5ed1c

Browse files
committed
Add a smoketest for ps.usedistiller="xpdf".
1 parent 05a09d6 commit 2c5ed1c

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

azure-pipelines.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ steps:
7272
libgirepository-1.0.1 \
7373
lmodern \
7474
fonts-freefont-otf \
75+
poppler-utils \
7576
texlive-pictures \
7677
texlive-fonts-recommended \
7778
texlive-latex-base \

lib/matplotlib/tests/test_backend_ps.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,16 @@
2323
@pytest.mark.parametrize('orientation', ['portrait', 'landscape'])
2424
@pytest.mark.parametrize('format, use_log, rcParams', [
2525
('ps', False, {}),
26-
pytest.param('ps', False, {'ps.usedistiller': 'ghostscript'},
27-
marks=needs_ghostscript),
28-
pytest.param('ps', False, {'text.usetex': True},
29-
marks=[needs_ghostscript, needs_usetex]),
26+
('ps', False, {'ps.usedistiller': 'ghostscript'}),
27+
('ps', False, {'ps.usedistiller': 'xpdf'}),
28+
('ps', False, {'text.usetex': True}),
3029
('eps', False, {}),
3130
('eps', True, {'ps.useafm': True}),
32-
pytest.param('eps', False, {'text.usetex': True},
33-
marks=[needs_ghostscript, needs_usetex]),
31+
('eps', False, {'text.usetex': True}),
3432
], ids=[
3533
'ps',
36-
'ps with distiller',
34+
'ps with distiller=ghostscript',
35+
'ps with distiller=xpdf',
3736
'ps with usetex',
3837
'eps',
3938
'eps afm',
@@ -56,8 +55,16 @@ def test_savefig_to_stringio(format, use_log, rcParams, orientation,
5655
if not mpl.rcParams["text.usetex"]:
5756
title += " \N{MINUS SIGN}\N{EURO SIGN}"
5857
ax.set_title(title)
59-
fig.savefig(s_buf, format=format, orientation=orientation)
60-
fig.savefig(b_buf, format=format, orientation=orientation)
58+
try:
59+
fig.savefig(s_buf, format=format, orientation=orientation)
60+
fig.savefig(b_buf, format=format, orientation=orientation)
61+
# ps.usedistiller emits an ExecutableNotFoundError; usetex emits a
62+
# RuntimeError.
63+
except (mpl.ExecutableNotFoundError, RuntimeError) as exc:
64+
if rcParams.get("ps.usedistiller") or rcParams.get("text.usetex"):
65+
pytest.skip(str(exc))
66+
else:
67+
raise
6168

6269
s_val = s_buf.getvalue().encode('ascii')
6370
b_val = b_buf.getvalue()

0 commit comments

Comments
 (0)
0