diff options
| author | Benjamin Peterson <benjamin@python.org> | 2012-09-29 18:14:19 (GMT) |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2012-09-29 18:14:19 (GMT) |
| commit | 14fb44e1bab9db128770f1d91d244916a669e7c3 (patch) | |
| tree | 278d9ccc8f819b05f8114c3154087c70b88ed69c /Lib/test/test_decimal.py | |
| parent | 1764c80925795b6f059e961c5a352c5ece5a7fff (diff) | |
| parent | 99a247fd01c1cd780c0c3ee1116657627f1ee744 (diff) | |
| download | cpython-14fb44e1bab9db128770f1d91d244916a669e7c3.zip cpython-14fb44e1bab9db128770f1d91d244916a669e7c3.tar.gz cpython-14fb44e1bab9db128770f1d91d244916a669e7c3.tar.bz2 | |
merge mostly from default
Diffstat (limited to 'Lib/test/test_decimal.py')
| -rw-r--r-- | Lib/test/test_decimal.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index 3ca5927..ec5db9f 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -34,7 +34,8 @@ import numbers import locale from test.support import (run_unittest, run_doctest, is_resource_enabled, requires_IEEE_754) -from test.support import check_warnings, import_fresh_module, TestFailed +from test.support import (check_warnings, import_fresh_module, TestFailed, + run_with_locale) import random import time import warnings @@ -1136,18 +1137,19 @@ class FormatTest(unittest.TestCase): self.assertEqual(get_fmt(Decimal('-1.5'), dotsep_wide, '020n'), '-0\u00b4000\u00b4000\u00b4000\u00b4001\u00bf5') + @run_with_locale('LC_ALL', 'ps_AF') def test_wide_char_separator_decimal_point(self): # locale with wide char separator and decimal point + import locale Decimal = self.decimal.Decimal - try: - locale.setlocale(locale.LC_ALL, 'ps_AF') - except locale.Error: + decimal_point = locale.localeconv()['decimal_point'] + thousands_sep = locale.localeconv()['thousands_sep'] + if decimal_point != '\u066b' or thousands_sep != '\u066c': return self.assertEqual(format(Decimal('100000000.123'), 'n'), '100\u066c000\u066c000\u066b123') - locale.resetlocale() class CFormatTest(FormatTest): decimal = C |
