diff options
author | Garvit Khatri <garvit.khatri@zomato.com> | 2017-03-28 15:43:38 (GMT) |
---|---|---|
committer | R. David Murray <rdmurray@bitdance.com> | 2017-03-28 15:43:38 (GMT) |
commit | 1cf93a76c2cf307f2e1e514a8944864f746337ea (patch) | |
tree | 85c7a1a948d17182efeaf6e6405ac64105f87f99 /Lib/test/test_types.py | |
parent | c8fa45bac2942accdb24dde318f87c9eb21dbfde (diff) | |
download | cpython-1cf93a76c2cf307f2e1e514a8944864f746337ea.zip cpython-1cf93a76c2cf307f2e1e514a8944864f746337ea.tar.gz cpython-1cf93a76c2cf307f2e1e514a8944864f746337ea.tar.bz2 |
bpo-10379: add 'monetary' to format_string, deprecate format
Add the 'monetary' parameter to format_string so that all
uses of format can be converted to format_string. Adjust
the documentation accordingly, and add a deprecation
warning when format is used.
Diffstat (limited to 'Lib/test/test_types.py')
-rw-r--r-- | Lib/test/test_types.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py index 4a9fcba..67d3281 100644 --- a/Lib/test/test_types.py +++ b/Lib/test/test_types.py @@ -381,8 +381,8 @@ class TypesTests(unittest.TestCase): for i in range(-10, 10): x = 1234567890.0 * (10.0 ** i) - self.assertEqual(locale.format('%g', x, grouping=True), format(x, 'n')) - self.assertEqual(locale.format('%.10g', x, grouping=True), format(x, '.10n')) + self.assertEqual(locale.format_string('%g', x, grouping=True), format(x, 'n')) + self.assertEqual(locale.format_string('%.10g', x, grouping=True), format(x, '.10n')) @run_with_locale('LC_NUMERIC', 'en_US.UTF8') def test_int__format__locale(self): @@ -390,7 +390,7 @@ class TypesTests(unittest.TestCase): x = 123456789012345678901234567890 for i in range(0, 30): - self.assertEqual(locale.format('%d', x, grouping=True), format(x, 'n')) + self.assertEqual(locale.format_string('%d', x, grouping=True), format(x, 'n')) # move to the next integer to test x = x // 10 |