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.
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 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 @@
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