File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -220,13 +220,14 @@ def test_pdf_savefig_when_color_is_none(tmpdir):
220220 assert result is None
221221
222222
223+ @needs_usetex
223224def test_failing_latex (tmpdir ):
224225 """Test failing latex subprocess call"""
225- path = tmpdir .join ("tmpoutput.pdf" )
226+ path = str ( tmpdir .join ("tmpoutput.pdf" ) )
226227
227228 rcParams ['text.usetex' ] = True
228229
229- # This failes with "Double subscript"
230- plt .xlabel ("$%f_2_2$" % np . random . random () )
231- with pytest .raises (RuntimeError ) as excinfo :
230+ # This fails with "Double subscript"
231+ plt .xlabel ("$22_2_2$" )
232+ with pytest .raises (RuntimeError ):
232233 plt .savefig (path )
Original file line number Diff line number Diff line change 1111
1212import matplotlib
1313import matplotlib .pyplot as plt
14- from matplotlib import patheffects , rcParams
14+ from matplotlib import patheffects
1515from matplotlib .testing .decorators import image_comparison
1616from matplotlib .testing .determinism import (_determinism_source_date_epoch ,
1717 _determinism_check )
@@ -162,11 +162,11 @@ def test_transparency():
162162@needs_usetex
163163def test_failing_latex (tmpdir ):
164164 """Test failing latex subprocess call"""
165- path = tmpdir .join ("tmpoutput.ps" )
165+ path = str ( tmpdir .join ("tmpoutput.ps" ) )
166166
167- rcParams ['text.usetex' ] = True
167+ matplotlib . rcParams ['text.usetex' ] = True
168168
169- # This failes with "Double subscript"
170- plt .xlabel ("$%f_2_2$" % np . random . random () )
171- with pytest .raises (RuntimeError ) as excinfo :
169+ # This fails with "Double subscript"
170+ plt .xlabel ("$22_2_2$" )
171+ with pytest .raises (RuntimeError ):
172172 plt .savefig (path )
You can’t perform that action at this time.
0 commit comments