mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-42224: Fix test_format when locale does not expect number grouping (GH-23067)
This commit is contained in:
parent
64366fa9b3
commit
301822859b
1 changed files with 5 additions and 2 deletions
|
@ -428,13 +428,16 @@ class FormatTest(unittest.TestCase):
|
|||
localeconv = locale.localeconv()
|
||||
sep = localeconv['thousands_sep']
|
||||
point = localeconv['decimal_point']
|
||||
grouping = localeconv['grouping']
|
||||
|
||||
text = format(123456789, "n")
|
||||
self.assertIn(sep, text)
|
||||
if grouping:
|
||||
self.assertIn(sep, text)
|
||||
self.assertEqual(text.replace(sep, ''), '123456789')
|
||||
|
||||
text = format(1234.5, "n")
|
||||
self.assertIn(sep, text)
|
||||
if grouping:
|
||||
self.assertIn(sep, text)
|
||||
self.assertIn(point, text)
|
||||
self.assertEqual(text.replace(sep, ''), '1234' + point + '5')
|
||||
finally:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue