summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2012-02-24 01:48:13 (GMT)
committerBrett Cannon <brett@python.org>2012-02-24 01:48:13 (GMT)
commit2fe4bb10e74e8950d011fb7b7f1a46f83955d805 (patch)
treed2c29e5adbb76c731d4465d89fd25bd339fe26f8 /Lib
parent4b03b6863575c7e85cc7ec3e8e25034b37043986 (diff)
parent90f50d4df9e21093f006427fd7ed11a0d704f792 (diff)
downloadcpython-2fe4bb10e74e8950d011fb7b7f1a46f83955d805.zip
cpython-2fe4bb10e74e8950d011fb7b7f1a46f83955d805.tar.gz
cpython-2fe4bb10e74e8950d011fb7b7f1a46f83955d805.tar.bz2
merge
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_format.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py
index 70e748f..dc324af 100644
--- a/Lib/test/test_format.py
+++ b/Lib/test/test_format.py
@@ -289,10 +289,18 @@ class FormatTest(unittest.TestCase):
except locale.Error as err:
self.skipTest("Cannot set locale: {}".format(err))
try:
- sep = locale.localeconv()['thousands_sep']
+ localeconv = locale.localeconv()
+ sep = localeconv['thousands_sep']
+ point = localeconv['decimal_point']
+
text = format(123456789, "n")
self.assertIn(sep, text)
self.assertEqual(text.replace(sep, ''), '123456789')
+
+ text = format(1234.5, "n")
+ self.assertIn(sep, text)
+ self.assertIn(point, text)
+ self.assertEqual(text.replace(sep, ''), '1234' + point + '5')
finally:
locale.setlocale(locale.LC_ALL, oldloc)