Skip to content

Commit e072e91

Browse files
committed
Update more results for newer Ghostscript.
This is necessary on Ubuntu 20.04, which has Ghostscript 9.50.
1 parent 7efb12e commit e072e91

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.

lib/matplotlib/tests/test_backend_pgf.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,18 @@ def test_xelatex():
8787
create_figure()
8888

8989

90+
try:
91+
_old_gs_version = mpl._get_executable_info('gs').version < '9.50'
92+
except mpl.ExecutableNotFoundError:
93+
_old_gs_version = True
94+
95+
9096
# test compiling a figure to pdf with pdflatex
9197
@needs_pdflatex
9298
@pytest.mark.skipif(not _has_tex_package('ucs'), reason='needs ucs.sty')
9399
@pytest.mark.backend('pgf')
94-
@image_comparison(['pgf_pdflatex.pdf'], style='default')
100+
@image_comparison(['pgf_pdflatex.pdf'], style='default',
101+
tol=11.7 if _old_gs_version else 0)
95102
def test_pdflatex():
96103
if os.environ.get('APPVEYOR'):
97104
pytest.xfail("pdflatex test does not work on appveyor due to missing "
@@ -127,15 +134,15 @@ def test_rcupdate():
127134
'pgf.preamble': ('\\usepackage[utf8x]{inputenc}'
128135
'\\usepackage[T1]{fontenc}'
129136
'\\usepackage{sfmath}')}]
130-
tol = [6, 0]
137+
tol = [0, 13.2] if _old_gs_version else [0, 0]
131138
for i, rc_set in enumerate(rc_sets):
132139
with mpl.rc_context(rc_set):
133140
for substring, pkg in [('sfmath', 'sfmath'), ('utf8x', 'ucs')]:
134141
if (substring in mpl.rcParams['pgf.preamble']
135142
and not _has_tex_package(pkg)):
136143
pytest.skip(f'needs {pkg}.sty')
137144
create_figure()
138-
compare_figure('pgf_rcupdate%d.pdf' % (i + 1), tol=tol[i])
145+
compare_figure(f'pgf_rcupdate{i + 1}.pdf', tol=tol[i])
139146

140147

141148
# test backend-side clipping, since large numbers are not supported by TeX

0 commit comments

Comments
 (0)