Skip to content

Commit 6a69b3e

Browse files
committed
Rename test markers
1 parent d0bef3b commit 6a69b3e

File tree

3 files changed

+27
-25
lines changed

3 files changed

+27
-25
lines changed

lib/matplotlib/testing/_markers.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ def _checkdep_usetex():
3434
needs_ghostscript = pytest.mark.skipif(
3535
"eps" not in matplotlib.testing.compare.converter,
3636
reason="This test needs a ghostscript installation")
37-
needs_lualatex = pytest.mark.skipif(
37+
needs_pgf_lualatex = pytest.mark.skipif(
3838
not matplotlib.testing._check_for_pgf('lualatex'),
3939
reason='lualatex + pgf is required')
40-
needs_pdflatex = pytest.mark.skipif(
40+
needs_pgf_pdflatex = pytest.mark.skipif(
4141
not matplotlib.testing._check_for_pgf('pdflatex'),
4242
reason='pdflatex + pgf is required')
43+
needs_pgf_xelatex = pytest.mark.skipif(
44+
not matplotlib.testing._check_for_pgf('xelatex'),
45+
reason='xelatex + pgf is required')
4346
needs_usetex = pytest.mark.skipif(
4447
not _checkdep_usetex(),
4548
reason="This test needs a TeX installation")
46-
needs_xelatex = pytest.mark.skipif(
47-
not matplotlib.testing._check_for_pgf('xelatex'),
48-
reason='xelatex + pgf is required')

lib/matplotlib/tests/test_backend_bases.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
FigureCanvasBase, LocationEvent, MouseButton, MouseEvent,
66
NavigationToolbar2, RendererBase)
77
from matplotlib.figure import Figure
8-
from matplotlib.testing._markers import needs_xelatex
8+
from matplotlib.testing._markers import needs_pgf_xelatex
99
import matplotlib.pyplot as plt
1010

1111
import numpy as np
@@ -251,7 +251,8 @@ def test_toolbar_zoompan():
251251

252252

253253
@pytest.mark.parametrize(
254-
"backend", ['svg', 'ps', 'pdf', pytest.param('pgf', marks=needs_xelatex)]
254+
"backend", ['svg', 'ps', 'pdf',
255+
pytest.param('pgf', marks=needs_pgf_xelatex)]
255256
)
256257
def test_draw(backend):
257258
from matplotlib.figure import Figure

lib/matplotlib/tests/test_backend_pgf.py

+19-18
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
from matplotlib.testing.decorators import (
1616
_image_directories, check_figures_equal, image_comparison)
1717
from matplotlib.testing._markers import (
18-
needs_ghostscript, needs_lualatex, needs_pdflatex, needs_xelatex)
18+
needs_ghostscript, needs_pgf_lualatex, needs_pgf_pdflatex,
19+
needs_pgf_xelatex)
1920

2021

2122
baseline_dir, result_dir = _image_directories(lambda: 'dummy func')
@@ -70,7 +71,7 @@ def test_tex_escape(plain_text, escaped_text):
7071

7172

7273
# test compiling a figure to pdf with xelatex
73-
@needs_xelatex
74+
@needs_pgf_xelatex
7475
@pytest.mark.backend('pgf')
7576
@image_comparison(['pgf_xelatex.pdf'], style='default')
7677
def test_xelatex():
@@ -88,7 +89,7 @@ def test_xelatex():
8889

8990

9091
# test compiling a figure to pdf with pdflatex
91-
@needs_pdflatex
92+
@needs_pgf_pdflatex
9293
@pytest.mark.skipif(not _has_tex_package('ucs'), reason='needs ucs.sty')
9394
@pytest.mark.backend('pgf')
9495
@image_comparison(['pgf_pdflatex.pdf'], style='default',
@@ -108,8 +109,8 @@ def test_pdflatex():
108109

109110

110111
# test updating the rc parameters for each figure
111-
@needs_xelatex
112-
@needs_pdflatex
112+
@needs_pgf_xelatex
113+
@needs_pgf_pdflatex
113114
@mpl.style.context('default')
114115
@pytest.mark.backend('pgf')
115116
def test_rcupdate():
@@ -140,7 +141,7 @@ def test_rcupdate():
140141

141142

142143
# test backend-side clipping, since large numbers are not supported by TeX
143-
@needs_xelatex
144+
@needs_pgf_xelatex
144145
@mpl.style.context('default')
145146
@pytest.mark.backend('pgf')
146147
def test_pathclip():
@@ -160,7 +161,7 @@ def test_pathclip():
160161

161162

162163
# test mixed mode rendering
163-
@needs_xelatex
164+
@needs_pgf_xelatex
164165
@pytest.mark.backend('pgf')
165166
@image_comparison(['pgf_mixedmode.pdf'], style='default')
166167
def test_mixedmode():
@@ -170,7 +171,7 @@ def test_mixedmode():
170171

171172

172173
# test bbox_inches clipping
173-
@needs_xelatex
174+
@needs_pgf_xelatex
174175
@mpl.style.context('default')
175176
@pytest.mark.backend('pgf')
176177
def test_bbox_inches():
@@ -187,9 +188,9 @@ def test_bbox_inches():
187188
@mpl.style.context('default')
188189
@pytest.mark.backend('pgf')
189190
@pytest.mark.parametrize('system', [
190-
pytest.param('lualatex', marks=[needs_lualatex]),
191-
pytest.param('pdflatex', marks=[needs_pdflatex]),
192-
pytest.param('xelatex', marks=[needs_xelatex]),
191+
pytest.param('lualatex', marks=[needs_pgf_lualatex]),
192+
pytest.param('pdflatex', marks=[needs_pgf_pdflatex]),
193+
pytest.param('xelatex', marks=[needs_pgf_xelatex]),
193194
])
194195
def test_pdf_pages(system):
195196
rc_pdflatex = {
@@ -229,9 +230,9 @@ def test_pdf_pages(system):
229230
@mpl.style.context('default')
230231
@pytest.mark.backend('pgf')
231232
@pytest.mark.parametrize('system', [
232-
pytest.param('lualatex', marks=[needs_lualatex]),
233-
pytest.param('pdflatex', marks=[needs_pdflatex]),
234-
pytest.param('xelatex', marks=[needs_xelatex]),
233+
pytest.param('lualatex', marks=[needs_pgf_lualatex]),
234+
pytest.param('pdflatex', marks=[needs_pgf_pdflatex]),
235+
pytest.param('xelatex', marks=[needs_pgf_xelatex]),
235236
])
236237
def test_pdf_pages_metadata_check(monkeypatch, system):
237238
# Basically the same as test_pdf_pages, but we keep it separate to leave
@@ -283,7 +284,7 @@ def test_pdf_pages_metadata_check(monkeypatch, system):
283284
}
284285

285286

286-
@needs_xelatex
287+
@needs_pgf_xelatex
287288
def test_tex_restart_after_error():
288289
fig = plt.figure()
289290
fig.suptitle(r"\oops")
@@ -295,14 +296,14 @@ def test_tex_restart_after_error():
295296
fig.savefig(BytesIO(), format="pgf")
296297

297298

298-
@needs_xelatex
299+
@needs_pgf_xelatex
299300
def test_bbox_inches_tight():
300301
fig, ax = plt.subplots()
301302
ax.imshow([[0, 1], [2, 3]])
302303
fig.savefig(BytesIO(), format="pdf", backend="pgf", bbox_inches="tight")
303304

304305

305-
@needs_xelatex
306+
@needs_pgf_xelatex
306307
@needs_ghostscript
307308
def test_png_transparency(): # Actually, also just testing that png works.
308309
buf = BytesIO()
@@ -312,7 +313,7 @@ def test_png_transparency(): # Actually, also just testing that png works.
312313
assert (t[..., 3] == 0).all() # fully transparent.
313314

314315

315-
@needs_xelatex
316+
@needs_pgf_xelatex
316317
def test_unknown_font(caplog):
317318
with caplog.at_level("WARNING"):
318319
mpl.rcParams["font.family"] = "this-font-does-not-exist"

0 commit comments

Comments
 (0)