Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 63a976e114f4c20656ca211b7f545b329d1b6675 authored by Barry Warsaw on 14 April 2009, 13:16:19 UTC
Bumping to 2.6.2 (final).
Tip revision: 63a976e
test_pickletools.py
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()
back to top