Skip to content

Commit c2ae3d6

Browse files
committed
Add test for parsing mathtext
1 parent 367026f commit c2ae3d6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/matplotlib/tests/test_text.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,3 +731,13 @@ def test_unsupported_script(recwarn):
731731
[warn.message.args for warn in recwarn] ==
732732
[(r"Glyph 2534 (\N{BENGALI DIGIT ZERO}) missing from current font.",),
733733
(r"Matplotlib currently does not support Bengali natively.",)])
734+
735+
736+
def test_parse_math():
737+
fig, ax = plt.subplots()
738+
ax.text(0, 0, r"$ \wrong{math} $", parse_math=False)
739+
fig.canvas.draw()
740+
741+
with pytest.raises(ValueError, match='Unknown symbol'):
742+
ax.text(0, 0, r"$ \wrong{math} $", parse_math=True)
743+
fig.canvas.draw()

0 commit comments

Comments
 (0)