1515from matplotlib .testing .decorators import (
1616 _image_directories , check_figures_equal , image_comparison )
1717from 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
2122baseline_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' )
7677def 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' )
115116def 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' )
146147def 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' )
166167def 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' )
176177def 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])
194195def 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])
236237def 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
287288def 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
299300def 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
307308def 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
316317def test_unknown_font (caplog ):
317318 with caplog .at_level ("WARNING" ):
318319 mpl .rcParams ["font.family" ] = "this-font-does-not-exist"
0 commit comments