summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMiss Skeleton (bot) <31488909+miss-islington@users.noreply.github.com>2020-11-02 15:46:00 (GMT)
committerGitHub <noreply@github.com>2020-11-02 15:46:00 (GMT)
commit1e96de9ed4b1ca96d345b7e309a8fe3802638f4a (patch)
tree4bcad76c8cf7d3d8999b2c058defe21466f52580 /Lib
parentad37c66adcd474e3d42a51c63ecb6a54ca2d23f2 (diff)
downloadcpython-1e96de9ed4b1ca96d345b7e309a8fe3802638f4a.zip
cpython-1e96de9ed4b1ca96d345b7e309a8fe3802638f4a.tar.gz
cpython-1e96de9ed4b1ca96d345b7e309a8fe3802638f4a.tar.bz2
bpo-42224: Fix test_format when locale does not expect number grouping (GH-23067)
(cherry picked from commit 301822859b3fc34801a06f1090d62f9f2ee5b092) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_format.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py
index 4559cd5..2dd9ca5 100644
--- a/Lib/test/test_format.py
+++ b/Lib/test/test_format.py
@@ -427,13 +427,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: