File tree 2 files changed +11
-10
lines changed
2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -220,13 +220,14 @@ def test_pdf_savefig_when_color_is_none(tmpdir):
220
220
assert result is None
221
221
222
222
223
+ @needs_usetex
223
224
def test_failing_latex (tmpdir ):
224
225
"""Test failing latex subprocess call"""
225
- path = tmpdir .join ("tmpoutput.pdf" )
226
+ path = str ( tmpdir .join ("tmpoutput.pdf" ) )
226
227
227
228
rcParams ['text.usetex' ] = True
228
229
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 ):
232
233
plt .savefig (path )
Original file line number Diff line number Diff line change 11
11
12
12
import matplotlib
13
13
import matplotlib .pyplot as plt
14
- from matplotlib import patheffects , rcParams
14
+ from matplotlib import patheffects
15
15
from matplotlib .testing .decorators import image_comparison
16
16
from matplotlib .testing .determinism import (_determinism_source_date_epoch ,
17
17
_determinism_check )
@@ -162,11 +162,11 @@ def test_transparency():
162
162
@needs_usetex
163
163
def test_failing_latex (tmpdir ):
164
164
"""Test failing latex subprocess call"""
165
- path = tmpdir .join ("tmpoutput.ps" )
165
+ path = str ( tmpdir .join ("tmpoutput.ps" ) )
166
166
167
- rcParams ['text.usetex' ] = True
167
+ matplotlib . rcParams ['text.usetex' ] = True
168
168
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 ):
172
172
plt .savefig (path )
You can’t perform that action at this time.
0 commit comments