From 7c62e05b29e144984baf3776a2313f29c1c6bbdd Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Fri, 5 Mar 2021 01:29:03 +0100 Subject: [PATCH] Don't turn check_for_pgf into public API. It was accidentally(?) added to the public API in the yet-to-be-released 1173770. --- lib/matplotlib/testing/__init__.py | 2 +- lib/matplotlib/tests/test_backend_bases.py | 4 ++-- lib/matplotlib/tests/test_backend_pgf.py | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/matplotlib/testing/__init__.py b/lib/matplotlib/testing/__init__.py index ca51fbc0fd00..f9c547ce00aa 100644 --- a/lib/matplotlib/testing/__init__.py +++ b/lib/matplotlib/testing/__init__.py @@ -49,7 +49,7 @@ def setup(): set_reproducibility_for_testing() -def check_for_pgf(texsystem): +def _check_for_pgf(texsystem): """ Check if a given TeX system + pgf is available diff --git a/lib/matplotlib/tests/test_backend_bases.py b/lib/matplotlib/tests/test_backend_bases.py index 8288cd1f2190..3de34caa4e35 100644 --- a/lib/matplotlib/tests/test_backend_bases.py +++ b/lib/matplotlib/tests/test_backend_bases.py @@ -1,6 +1,6 @@ import re -from matplotlib.testing import check_for_pgf +from matplotlib.testing import _check_for_pgf from matplotlib.backend_bases import ( FigureCanvasBase, LocationEvent, MouseButton, MouseEvent, NavigationToolbar2, RendererBase) @@ -14,7 +14,7 @@ import numpy as np import pytest -needs_xelatex = pytest.mark.skipif(not check_for_pgf('xelatex'), +needs_xelatex = pytest.mark.skipif(not _check_for_pgf('xelatex'), reason='xelatex + pgf is required') diff --git a/lib/matplotlib/tests/test_backend_pgf.py b/lib/matplotlib/tests/test_backend_pgf.py index 7d10c13ce3a8..75f50ecbf0d9 100644 --- a/lib/matplotlib/tests/test_backend_pgf.py +++ b/lib/matplotlib/tests/test_backend_pgf.py @@ -8,7 +8,7 @@ import matplotlib as mpl import matplotlib.pyplot as plt -from matplotlib.testing import _has_tex_package, check_for_pgf +from matplotlib.testing import _has_tex_package, _check_for_pgf from matplotlib.testing.compare import compare_images, ImageComparisonFailure from matplotlib.backends.backend_pgf import PdfPages, common_texification from matplotlib.testing.decorators import (_image_directories, @@ -17,11 +17,11 @@ baseline_dir, result_dir = _image_directories(lambda: 'dummy func') -needs_xelatex = pytest.mark.skipif(not check_for_pgf('xelatex'), +needs_xelatex = pytest.mark.skipif(not _check_for_pgf('xelatex'), reason='xelatex + pgf is required') -needs_pdflatex = pytest.mark.skipif(not check_for_pgf('pdflatex'), +needs_pdflatex = pytest.mark.skipif(not _check_for_pgf('pdflatex'), reason='pdflatex + pgf is required') -needs_lualatex = pytest.mark.skipif(not check_for_pgf('lualatex'), +needs_lualatex = pytest.mark.skipif(not _check_for_pgf('lualatex'), reason='lualatex + pgf is required') needs_ghostscript = pytest.mark.skipif( "eps" not in mpl.testing.compare.converter, @@ -311,7 +311,7 @@ def test_unknown_font(caplog): @pytest.mark.parametrize("texsystem", ("pdflatex", "xelatex", "lualatex")) @pytest.mark.backend("pgf") def test_minus_signs_with_tex(fig_test, fig_ref, texsystem): - if not check_for_pgf(texsystem): + if not _check_for_pgf(texsystem): pytest.skip(texsystem + ' + pgf is required') mpl.rcParams["pgf.texsystem"] = texsystem fig_test.text(.5, .5, "$-1$")