Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 47a6b13

Browse files
committed
Temporary hacks to arrange that the pickle tests relying on protocol 2
only get run by test_pickle.py now (& not by test_cpickle.py). This should be undone when protocol 2 is implemented in cPickle too. test_cpickle should pass again.
1 parent 4e2491d commit 47a6b13

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

Lib/test/pickletester.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,12 @@ def test_newobj_list(self):
324324
## print
325325
## pickletools.dis(s)
326326

327+
# XXX Temporary hack, so long as the C implementation of pickle protocol
328+
# XXX 2 isn't ready. When it is, move the methods in TempAbstractPickleTests
329+
# XXX into AbstractPickleTests above, and get rid of TempAbstractPickleTests
330+
# XXX along with the references to it in test_pickle.py.
331+
class TempAbstractPickleTests(unittest.TestCase):
332+
327333
def test_newobj_list_slots(self):
328334
x = SlotList([1, 2, 3])
329335
x.foo = 42

Lib/test/test_pickle.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import pickle
22
import unittest
33
from cStringIO import StringIO
4-
from test.pickletester import AbstractPickleTests, AbstractPickleModuleTests, \
5-
AbstractPersistentPicklerTests
4+
65
from test import test_support
76

8-
class PickleTests(AbstractPickleTests, AbstractPickleModuleTests):
7+
from test.pickletester import AbstractPickleTests
8+
from test.pickletester import TempAbstractPickleTests as XXXTemp
9+
from test.pickletester import AbstractPickleModuleTests
10+
from test.pickletester import AbstractPersistentPicklerTests
11+
12+
class PickleTests(AbstractPickleTests, AbstractPickleModuleTests, XXXTemp):
913

1014
def setUp(self):
1115
self.dumps = pickle.dumps

0 commit comments

Comments
 (0)