cpython/Lib/test/test_pickletools.py
Alexander Belopolsky ec8f0df229 Merged revisions 88546 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r88546 | alexander.belopolsky | 2011-02-24 14:40:09 -0500 (Thu, 24 Feb 2011) | 3 lines

  Issue #11286: Fixed unpickling of empty 2.x strings.
........
2011-02-24 20:34:38 +00:00

26 lines
643 B
Python

import pickle
import pickletools
from test import support
from test.pickletester import AbstractPickleTests
from test.pickletester import AbstractPickleModuleTests
class OptimizedPickleTests(AbstractPickleTests, AbstractPickleModuleTests):
def dumps(self, arg, proto=None):
return pickletools.optimize(pickle.dumps(arg, proto))
def loads(self, buf, **kwds):
return pickle.loads(buf, **kwds)
# Test relies on precise output of dumps()
test_pickle_to_2x = None
def test_main():
support.run_unittest(OptimizedPickleTests)
support.run_doctest(pickletools)
if __name__ == "__main__":
test_main()