Commit 8ae7a5c1 authored by Tres Seaver's avatar Tres Seaver

Suppress protocol 3 pickle tests on Python2.

parent 935be033
......@@ -14,7 +14,12 @@
try:
# Python 2.x
from cPickle import Pickler, Unpickler, dump, dumps, loads
from cPickle import Pickler
from cPickle import Unpickler
from cPickle import dump
from cPickle import dumps
from cPickle import loads
from cPickle import HIGHEST_PROTOCOL
IMPORT_MAPPING = {}
NAME_MAPPING = {}
_protocol = 1
......@@ -22,6 +27,7 @@ except ImportError:
# Python 3.x: can't use stdlib's pickle because
# http://bugs.python.org/issue6784
import zodbpickle.pickle
HIGHEST_PROTOCOL = 3
from _compat_pickle import IMPORT_MAPPING, NAME_MAPPING
class Pickler(zodbpickle.pickle.Pickler):
......
......@@ -122,6 +122,8 @@ class TestUtils(unittest.TestCase):
def test_get_pickle_metadata_w_protocol_3_class_pickle(self):
from ZODB.utils import get_pickle_metadata
from ZODB._compat import dumps
from ZODB._compat import HIGHEST_PROTOCOL
if HIGHEST_PROTOCOL >= 3:
pickle = dumps(ExampleClass, protocol=3)
self.assertEqual(get_pickle_metadata(pickle),
(__name__, ExampleClass.__name__))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment