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.
9 from test
import test_support
10 from test
.pickletester
import AbstractPickleTests
12 class DumpCPickle_LoadPickle(AbstractPickleTests
):
16 def dumps(self
, arg
, proto
=0, fast
=0):
18 return cPickle
.dumps(arg
, proto
)
22 return pickle
.loads(buf
)
24 class DumpPickle_LoadCPickle(AbstractPickleTests
):
26 error
= cPickle
.BadPickleGet
28 def dumps(self
, arg
, proto
=0, fast
=0):
30 return pickle
.dumps(arg
, proto
)
34 return cPickle
.loads(buf
)
37 test_support
.run_unittest(
38 DumpCPickle_LoadPickle
,
39 DumpPickle_LoadCPickle
42 if __name__
== "__main__":