mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
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.
This commit is contained in:
parent
44a118af50
commit
de9b624fb9
6 changed files with 67 additions and 53 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue