summaryrefslogtreecommitdiff
path: root/Lib/test/test_format.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2012-02-24 01:44:47 +0100
committerVictor Stinner <victor.stinner@haypocalc.com>2012-02-24 01:44:47 +0100
commitc0cd820dd5983d13501dab01aab1fcf6380a8e0c (patch)
tree4a55ff0c5b61fbd892e8c54baff80ae5731bf391 /Lib/test/test_format.py
parent93e596e2610bbb386f3e11864af1c69b9ad6f13d (diff)
downloadcpython-c0cd820dd5983d13501dab01aab1fcf6380a8e0c.tar.gz
Issue #13706: Fix format(float, "n") for locale with non-ASCII decimal point (e.g. ps_aF)
Diffstat (limited to 'Lib/test/test_format.py')
-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 70e748f2c3..dc324af412 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)