@@ -1449,20 +1449,21 @@ def test_latex(self, is_latex, usetex, expected):
1449
1449
assert fmt .format_pct (50 , 100 ) == expected
1450
1450
1451
1451
1452
- @pytest .mark .xfail (locale != "fy_DE.UTF-8" ,
1453
- reason = "Locale 'fy_DE.UTF-8' is not supported" )
1452
+ @pytest .mark .xfail
1454
1453
def test_locale_comma ():
1455
1454
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 )
1466
1467
1467
1468
1468
1469
def test_majformatter_type ():
0 commit comments