diff options
author | Georg Brandl <georg@python.org> | 2006-05-18 06:33:27 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-05-18 06:33:27 (GMT) |
commit | fad65594ba25caada52b334b05f5f3f0994b9206 (patch) | |
tree | c058ced916fc4a01e008f7562f74fc95a92a47a4 /Lib | |
parent | bbab671d7dba9fe4c7ddf1ce9f904c21243e9ee3 (diff) | |
download | cpython-fad65594ba25caada52b334b05f5f3f0994b9206.zip cpython-fad65594ba25caada52b334b05f5f3f0994b9206.tar.gz cpython-fad65594ba25caada52b334b05f5f3f0994b9206.tar.bz2 |
Fix test_locale for platforms without a default thousands separator.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_locale.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py index ec5a533..9e264b9 100644 --- a/Lib/test/test_locale.py +++ b/Lib/test/test_locale.py @@ -52,23 +52,26 @@ try: # === Test format() with more complex formatting strings # test if grouping is independent from other characters in formatting string - testformat("One million is %i", 1000000, grouping=1, output='One million is 1,000,000', + testformat("One million is %i", 1000000, grouping=1, + output='One million is 1%s000%s000' % (sep, sep), func=locale.format_string) - testformat("One million is %i", 1000000, grouping=1, output='One million is 1,000,000', + testformat("One million is %i", 1000000, grouping=1, + output='One million is 1%s000%s000' % (sep, sep), func=locale.format_string) # test dots in formatting string testformat(".%f.", 1000.0, output='.1000.000000.', func=locale.format_string) # test floats - testformat("--> %10.2f", 1000.0, grouping=1, output='--> 1,000.00', + testformat("--> %10.2f", 1000.0, grouping=1, output='--> 1%s000.00' % sep, func=locale.format_string) # test asterisk formats testformat("%10.*f", (2, 1000.0), grouping=0, output=' 1000.00', func=locale.format_string) - testformat("%*.*f", (10, 2, 1000.0), grouping=1, output=' 1,000.00', + testformat("%*.*f", (10, 2, 1000.0), grouping=1, output=' 1%s000.00' % sep, func=locale.format_string) # test more-in-one testformat("int %i float %.2f str %s", (1000, 1000.0, 'str'), grouping=1, - output='int 1,000 float 1,000.00 str str', func=locale.format_string) + output='int 1%s000 float 1%s000.00 str str' % (sep, sep), + func=locale.format_string) finally: locale.setlocale(locale.LC_NUMERIC, oldlocale) |