@@ -163,29 +163,20 @@ def test_rcupdate():
163163@pytest .mark .style ('default' )
164164@pytest .mark .backend ('pgf' )
165165def test_pathclip ():
166- rc_xelatex = {'font.family' : 'serif' ,
167- 'pgf.rcfonts' : False }
168- mpl .rcParams .update (rc_xelatex )
169-
170- plt .figure ()
166+ mpl .rcParams .update ({'font.family' : 'serif' , 'pgf.rcfonts' : False })
171167 plt .plot ([0. , 1e100 ], [0. , 1e100 ])
172168 plt .xlim (0 , 1 )
173169 plt .ylim (0 , 1 )
174- # this test passes if compiling/saving to pdf works (no image comparison)
175- plt .savefig (os .path .join (result_dir , "pgf_pathclip.pdf" ))
170+ plt .savefig (BytesIO (), format = "pdf" ) # No image comparison.
176171
177172
178173# test mixed mode rendering
179174@needs_xelatex
180175@pytest .mark .backend ('pgf' )
181176@image_comparison (['pgf_mixedmode.pdf' ], style = 'default' )
182177def test_mixedmode ():
183- rc_xelatex = {'font.family' : 'serif' ,
184- 'pgf.rcfonts' : False }
185- mpl .rcParams .update (rc_xelatex )
186-
178+ mpl .rcParams .update ({'font.family' : 'serif' , 'pgf.rcfonts' : False })
187179 Y , X = np .ogrid [- 1 :1 :40j , - 1 :1 :40j ]
188- plt .figure ()
189180 plt .pcolor (X ** 2 + Y ** 2 ).set_rasterized (True )
190181
191182
@@ -194,15 +185,11 @@ def test_mixedmode():
194185@pytest .mark .style ('default' )
195186@pytest .mark .backend ('pgf' )
196187def test_bbox_inches ():
197- rc_xelatex = {'font.family' : 'serif' ,
198- 'pgf.rcfonts' : False }
199- mpl .rcParams .update (rc_xelatex )
200-
188+ mpl .rcParams .update ({'font.family' : 'serif' , 'pgf.rcfonts' : False })
201189 fig , (ax1 , ax2 ) = plt .subplots (1 , 2 )
202190 ax1 .plot (range (5 ))
203191 ax2 .plot (range (5 ))
204192 plt .tight_layout ()
205-
206193 bbox = ax1 .get_window_extent ().transformed (fig .dpi_scale_trans .inverted ())
207194 compare_figure ('pgf_bbox_inches.pdf' , savefig_kwargs = {'bbox_inches' : bbox },
208195 tol = 0 )
0 commit comments