Staging
v0.5.1
https://github.com/python/cpython
Revision 443ec6875f04c8111832307c047409792cd445d1 authored by Gregory P. Smith on 02 January 2010, 22:28:48 UTC, committed by Gregory P. Smith on 02 January 2010, 22:28:48 UTC
to hashlib functions in python 2.x.  The module now uses the 's*' for argument
parsing which auto encodes unicode objects to the system default encoding for
us.
1 parent c2fa18c
Raw File
Tip revision: 443ec6875f04c8111832307c047409792cd445d1 authored by Gregory P. Smith on 02 January 2010, 22:28:48 UTC
Issue #3745: Undo the requirement for new buffer API only objects to be passed
Tip revision: 443ec68
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