8000 Increase coverage (#26346) · randomrahulm/matplotlib@50e3717 · GitHub
[go: up one dir, main page]

Skip to content

Commit 50e3717

Browse files
authored
Increase coverage (matplotlib#26346)
* add test for strip_math * add test for strip_math
1 parent c6db591 commit 50e3717

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/matplotlib/tests/test_cbook.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from matplotlib import _api, cbook
1717
import matplotlib.colors as mcolors
18-
from matplotlib.cbook import delete_masked_points
18+
from matplotlib.cbook import delete_masked_points, strip_math
1919

2020

2121
class Test_delete_masked_points:
@@ -918,6 +918,12 @@ def test_safe_first_element_with_none():
918918
assert actual is not None and actual == datetime_lst[1]
919919

920920

921+
def test_strip_math():
922+
assert strip_math(r'1 \times 2') == r'1 \times 2'
923+
assert strip_math(r'$1 \times 2$') == '1 x 2'
924+
assert strip_math(r'$\rm{hi}$') == 'hi'
925+
926+
921927
@pytest.mark.parametrize('fmt, value, result', [
922928
('%.2f m', 0.2, '0.20 m'),
923929
('{:.2f} m', 0.2, '0.20 m'),

0 commit comments

Comments
 (0)
0