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

Skip to content

Commit b692160

Browse files
devRDoscargus
andauthored
Check format_string comma is unchanged
Co-authored-by: Oscar Gustafsson <[email protected]>
1 parent dd784c9 commit b692160

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/matplotlib/tests/test_ticker.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1457,8 +1457,12 @@ def test_locale_comma():
14571457
ticks = mticker.ScalarFormatter(useMathText=True, useLocale=True)
14581458
fmt = '$\\mathdefault{%1.1f}$'
14591459
x = ticks._format_maybe_minus_and_locale(fmt, 0.5)
1460-
locale.setlocale(locale.LC_ALL, currentLocale)
14611460
assert x == '$\\mathdefault{0{,}5}$'
1461+
# Do not change , in the format string
1462+
fmt = ',$\\mathdefault{,%1.1f},$'
1463+
x = ticks._format_maybe_minus_and_locale(fmt, 0.5)
1464+
assert x == ',$\\mathdefault{,0{,}5},$'
1465+
locale.setlocale(locale.LC_ALL, currentLocale)
14621466

14631467

14641468
def test_majformatter_type():

0 commit comments

Comments
 (0)