summaryrefslogtreecommitdiffstats
path: root/Lib/test/pickletester.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-04-30 11:13:56 (GMT)
committerGeorg Brandl <georg@python.org>2006-04-30 11:13:56 (GMT)
commitde9b624fb943295263f8140d9d2eda393348b8ec (patch)
tree5d2af20626e9afd98486b718235fa1f9b466812e /Lib/test/pickletester.py
parent44a118af5043ed6919bd1d0bcfc603f496ae4d7c (diff)
downloadcpython-de9b624fb943295263f8140d9d2eda393348b8ec.zip
cpython-de9b624fb943295263f8140d9d2eda393348b8ec.tar.gz
cpython-de9b624fb943295263f8140d9d2eda393348b8ec.tar.bz2
Bug #1473625: stop cPickle making float dumps locale dependent in protocol 0.
On the way, add a decorator to test_support to facilitate running single test functions in different locales with automatic cleanup.
Diffstat (limited to 'Lib/test/pickletester.py')
-rw-r--r--Lib/test/pickletester.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 85e1dea..5b9da56 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -4,7 +4,8 @@ import cPickle
import pickletools
import copy_reg
-from test.test_support import TestFailed, have_unicode, TESTFN
+from test.test_support import TestFailed, have_unicode, TESTFN, \
+ run_with_locale
# Tests that try a number of pickle protocols should have a
# for proto in protocols:
@@ -527,6 +528,11 @@ class AbstractPickleTests(unittest.TestCase):
got = self.loads(p)
self.assertEqual(n, got)
+ @run_with_locale('LC_ALL', 'de_DE', 'fr_FR')
+ def test_float_format(self):
+ # make sure that floats are formatted locale independent
+ self.assertEqual(self.dumps(1.2)[0:3], 'F1.')
+
def test_reduce(self):
pass