8000 Skip failing pgf test when sfmath.sty is not present. · matplotlib/matplotlib@9b45f55 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9b45f55

Browse files
committed
Skip failing pgf test when sfmath.sty is not present.
For the use of kpsewhich, see https://tex.stackexchange.com/questions/248305/checking-installed-packages (we already use kpsewhich elsewhere in the codebase too).
1 parent 1c6ee08 commit 9b45f55

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/matplotlib/tests/test_backend_pgf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ def check_for(texsystem):
4444
reason='lualatex + pgf is required')
4545

4646

47+
def _has_sfmath():
48+
return (shutil.which("kpsewhich")
49+
and subprocess.run(["kpsewhich", "sfmath.sty"],
50+
stdout=subprocess.PIPE).returncode == 0)
51+
52+
4753
def compare_figure(fname, savefig_kwargs={}, tol=0):
4854
actual = os.path.join(result_dir, fname)
4955
plt.savefig(actual, **savefig_kwargs)
@@ -113,6 +119,7 @@ def test_pdflatex():
113119
# test updating the rc parameters for each figure
114120
@needs_xelatex
115121
@needs_pdflatex
122+
@pytest.mark.skipif(not _has_sfmath(), reason='needs sfmath.sty')
116123
@pytest.mark.style('default')
117124
@pytest.mark.backend('pgf')
118125
def test_rcupdate():

0 commit comments

Comments
 (0)
0