1 # test_pickle dumps and loads pickles via pickle.py.
2 # test_cpickle does the same, but via the cPickle module.
3 # This test covers the other two cases, making pickles with one module and
4 # loading them via the other.
10 from test
import test_support
11 from test
.pickletester
import AbstractPickleTests
13 class DumpCPickle_LoadPickle(AbstractPickleTests
):
17 def dumps(self
, arg
, proto
=0, fast
=0):
19 return cPickle
.dumps(arg
, proto
)
23 return pickle
.loads(buf
)
25 class DumpPickle_LoadCPickle(AbstractPickleTests
):
27 error
= cPickle
.BadPickleGet
29 def dumps(self
, arg
, proto
=0, fast
=0):
31 return pickle
.dumps(arg
, proto
)
35 return cPickle
.loads(buf
)
38 test_support
.run_unittest(
39 DumpCPickle_LoadPickle
,
40 DumpPickle_LoadCPickle
43 if __name__
== "__main__":