15
15
from matplotlib .testing .decorators import (
16
16
_image_directories , check_figures_equal , image_comparison )
17
17
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 )
19
20
20
21
21
22
baseline_dir , result_dir = _image_directories (lambda : 'dummy func' )
@@ -70,7 +71,7 @@ def test_tex_escape(plain_text, escaped_text):
70
71
71
72
72
73
# test compiling a figure to pdf with xelatex
73
- @needs_xelatex
74
+ @needs_pgf_xelatex
74
75
@pytest .mark .backend ('pgf' )
75
76
@image_comparison (['pgf_xelatex.pdf' ], style = 'default' )
76
77
def test_xelatex ():
@@ -88,7 +89,7 @@ def test_xelatex():
88
89
89
90
90
91
# test compiling a figure to pdf with pdflatex
91
- @needs_pdflatex
92
+ @needs_pgf_pdflatex
92
93
@pytest .mark .skipif (not _has_tex_package ('ucs' ), reason = 'needs ucs.sty' )
93
94
@pytest .mark .backend ('pgf' )
94
95
@image_comparison (['pgf_pdflatex.pdf' ], style = 'default' ,
@@ -108,8 +109,8 @@ def test_pdflatex():
108
109
109
110
110
111
# test updating the rc parameters for each figure
111
- @needs_xelatex
112
- @needs_pdflatex
112
+ @needs_pgf_xelatex
113
+ @needs_pgf_pdflatex
113
114
@mpl .style .context ('default' )
114
115
@pytest .mark .backend ('pgf' )
115
116
def test_rcupdate ():
@@ -140,7 +141,7 @@ def test_rcupdate():
140
141
141
142
142
143
# test backend-side clipping, since large numbers are not supported by TeX
143
- @needs_xelatex
144
+ @needs_pgf_xelatex
144
145
@mpl .style .context ('default' )
145
146
@pytest .mark .backend ('pgf' )
146
147
def test_pathclip ():
@@ -160,7 +161,7 @@ def test_pathclip():
160
161
161
162
162
163
# test mixed mode rendering
163
- @needs_xelatex
164
+ @needs_pgf_xelatex
164
165
@pytest .mark .backend ('pgf' )
165
166
@image_comparison (['pgf_mixedmode.pdf' ], style = 'default' )
166
167
def test_mixedmode ():
@@ -170,7 +171,7 @@ def test_mixedmode():
170
171
171
172
172
173
# test bbox_inches clipping
173
- @needs_xelatex
174
+ @needs_pgf_xelatex
174
175
@mpl .style .context ('default' )
175
176
@pytest .mark .backend ('pgf' )
176
177
def test_bbox_inches ():
@@ -187,9 +188,9 @@ def test_bbox_inches():
187
188
@mpl .style .context ('default' )
188
189
@pytest .mark .backend ('pgf' )
189
190
@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 ]),
193
194
])
194
195
def test_pdf_pages (system ):
195
196
rc_pdflatex = {
@@ -229,9 +230,9 @@ def test_pdf_pages(system):
229
230
@mpl .style .context ('default' )
230
231
@pytest .mark .backend ('pgf' )
231
232
@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 ]),
235
236
])
236
237
def test_pdf_pages_metadata_check (monkeypatch , system ):
237
238
# 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):
283
284
}
284
285
285
286
286
- @needs_xelatex
287
+ @needs_pgf_xelatex
287
288
def test_tex_restart_after_error ():
288
289
fig = plt .figure ()
289
290
fig .suptitle (r"\oops" )
@@ -295,14 +296,14 @@ def test_tex_restart_after_error():
295
296
fig .savefig (BytesIO (), format = "pgf" )
296
297
297
298
298
- @needs_xelatex
299
+ @needs_pgf_xelatex
299
300
def test_bbox_inches_tight ():
300
301
fig , ax = plt .subplots ()
301
302
ax .imshow ([[0 , 1 ], [2 , 3 ]])
302
303
fig .savefig (BytesIO (), format = "pdf" , backend = "pgf" , bbox_inches = "tight" )
303
304
304
305
305
- @needs_xelatex
306
+ @needs_pgf_xelatex
306
307
@needs_ghostscript
307
308
def test_png_transparency (): # Actually, also just testing that png works.
308
309
buf = BytesIO ()
@@ -312,7 +313,7 @@ def test_png_transparency(): # Actually, also just testing that png works.
312
313
assert (t [..., 3 ] == 0 ).all () # fully transparent.
313
314
314
315
315
- @needs_xelatex
316
+ @needs_pgf_xelatex
316
317
def test_unknown_font (caplog ):
317
318
with caplog .at_level ("WARNING" ):
318
319
mpl .rcParams ["font.family" ] = "this-font-does-not-exist"
0 commit comments