mirror of
https://github.com/python/cpython.git
synced 2024-12-26 10:14:58 +08:00
126d29abf8
svn+ssh://pythondev@svn.python.org/python/trunk ........ r60731 | raymond.hettinger | 2008-02-11 19:51:08 +0100 (Mon, 11 Feb 2008) | 1 line No need to register classes that already inherit from ABCs. ........ r60733 | lars.gustaebel | 2008-02-11 20:17:10 +0100 (Mon, 11 Feb 2008) | 2 lines Make sure that xstar headers are read correctly. ........ r60734 | raymond.hettinger | 2008-02-11 21:05:53 +0100 (Mon, 11 Feb 2008) | 1 line Add tests for pickletools.optimize(). ........
25 lines
611 B
Python
25 lines
611 B
Python
import pickle
|
|
import pickletools
|
|
from test import test_support
|
|
from test.pickletester import AbstractPickleTests
|
|
from test.pickletester import AbstractPickleModuleTests
|
|
|
|
class OptimizedPickleTests(AbstractPickleTests, AbstractPickleModuleTests):
|
|
|
|
def dumps(self, arg, proto=0, fast=0):
|
|
return pickletools.optimize(pickle.dumps(arg, proto))
|
|
|
|
def loads(self, buf):
|
|
return pickle.loads(buf)
|
|
|
|
module = pickle
|
|
error = KeyError
|
|
|
|
def test_main():
|
|
test_support.run_unittest(OptimizedPickleTests)
|
|
test_support.run_doctest(pickletools)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
test_main()
|