@@ -1449,20 +1449,21 @@ def test_latex(self, is_latex, usetex, expected):
14491449 assert fmt .format_pct (50 , 100 ) == expected
14501450
14511451
1452- @pytest .mark .xfail (locale != "fy_DE.UTF-8" ,
1453- reason = "Locale 'fy_DE.UTF-8' is not supported" )
1452+ @pytest .mark .xfail
14541453def test_locale_comma ():
14551454 currentLocale = locale .getlocale ()
1456- locale .setlocale (locale .LC_ALL , 'fy_DE.UTF-8' )
1457- ticks = mticker .ScalarFormatter (useMathText = True , useLocale = True )
1458- fmt = '$\\ mathdefault{%1.1f}$'
1459- x = ticks ._format_maybe_minus_and_locale (fmt , 0.5 )
1460- 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 )
1455+ try :
1456+ locale .setlocale (locale .LC_ALL , 'fy_DE.UTF-8' )
1457+ ticks = mticker .ScalarFormatter (useMathText = True , useLocale = True )
1458+ fmt = '$\\ mathdefault{%1.1f}$'
1459+ x = ticks ._format_maybe_minus_and_locale (fmt , 0.5 )
1460+ 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+ finally :
1466+ locale .setlocale (locale .LC_ALL , currentLocale )
14661467
14671468
14681469def test_majformatter_type ():
0 commit comments