Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5c51676

Browse files
authored
Merge pull request #10180 from QuLogic/subprocesses
Rebase of #8504
2 parents 32a67d3 + 7cf0e22 commit 5c51676

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

lib/matplotlib/tests/test_backend_pdf.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,16 @@ def test_pdf_savefig_when_color_is_none(tmpdir):
218218
fig.savefig(str(expected_image), format='eps')
219219
result = compare_images(str(actual_image), str(expected_image), 0)
220220
assert result is None
221+
222+
223+
@needs_usetex
224+
def test_failing_latex(tmpdir):
225+
"""Test failing latex subprocess call"""
226+
path = str(tmpdir.join("tmpoutput.pdf"))
227+
228+
rcParams['text.usetex'] = True
229+
230+
# This fails with "Double subscript"
231+
plt.xlabel("$22_2_2$")
232+
with pytest.raises(RuntimeError):
233+
plt.savefig(path)

lib/matplotlib/tests/test_backend_ps.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,16 @@ def test_transparency():
157157
ax.set_axis_off()
158158
ax.plot([0, 1], color="r", alpha=0)
159159
ax.text(.5, .5, "foo", color="r", alpha=0)
160+
161+
162+
@needs_usetex
163+
def test_failing_latex(tmpdir):
164+
"""Test failing latex subprocess call"""
165+
path = str(tmpdir.join("tmpoutput.ps"))
166+
167+
matplotlib.rcParams['text.usetex'] = True
168+
169+
# This fails with "Double subscript"
170+
plt.xlabel("$22_2_2$")
171+
with pytest.raises(RuntimeError):
172+
plt.savefig(path)

0 commit comments

Comments
 (0)