Skip to content

Commit

Permalink
Skip dispatch table tests on Python 3.2
Browse files Browse the repository at this point in the history
These tests first appeared in Python 3.3.  I've no idea what they're
testing or why.
  • Loading branch information
mgedmin committed Mar 4, 2013
1 parent a2a85da commit d1beeb2
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions src/zodbpickle/tests/test_pickle.py
Expand Up @@ -2,6 +2,7 @@
import collections
import unittest
import doctest
import sys

from test import support

Expand Down Expand Up @@ -96,16 +97,17 @@ class PyPicklerUnpicklerObjectTests(AbstractPicklerUnpicklerObjectTests):
unpickler_class = pickle._Unpickler


class PyDispatchTableTests(AbstractDispatchTableTests):
pickler_class = pickle._Pickler
def get_dispatch_table(self):
return pickle.dispatch_table.copy()
if sys.version_info >= (3, 3):
class PyDispatchTableTests(AbstractDispatchTableTests):
pickler_class = pickle._Pickler
def get_dispatch_table(self):
return pickle.dispatch_table.copy()


class PyChainDispatchTableTests(AbstractDispatchTableTests):
pickler_class = pickle._Pickler
def get_dispatch_table(self):
return collections.ChainMap({}, pickle.dispatch_table)
class PyChainDispatchTableTests(AbstractDispatchTableTests):
pickler_class = pickle._Pickler
def get_dispatch_table(self):
return collections.ChainMap({}, pickle.dispatch_table)


if has_c_implementation:
Expand Down Expand Up @@ -137,29 +139,32 @@ class CPicklerUnpicklerObjectTests(AbstractPicklerUnpicklerObjectTests):
pickler_class = _pickle.Pickler
unpickler_class = _pickle.Unpickler

class CDispatchTableTests(AbstractDispatchTableTests):
pickler_class = pickle.Pickler
def get_dispatch_table(self):
return pickle.dispatch_table.copy()
if sys.version_info >= (3, 3):
class CDispatchTableTests(AbstractDispatchTableTests):
pickler_class = pickle.Pickler
def get_dispatch_table(self):
return pickle.dispatch_table.copy()

class CChainDispatchTableTests(AbstractDispatchTableTests):
pickler_class = pickle.Pickler
def get_dispatch_table(self):
return collections.ChainMap({}, pickle.dispatch_table)
class CChainDispatchTableTests(AbstractDispatchTableTests):
pickler_class = pickle.Pickler
def get_dispatch_table(self):
return collections.ChainMap({}, pickle.dispatch_table)


def choose_tests():
tests = [PickleTests, PyPicklerTests, PyPersPicklerTests,
PyDispatchTableTests, PyChainDispatchTableTests,
PyPicklerBytestrTests, PyPicklerBytesFallbackTests]
if sys.version_info >= (3, 3):
tests.extend([PyDispatchTableTests, PyChainDispatchTableTests])
if has_c_implementation:
tests.extend([CPicklerTests, CPersPicklerTests,
CPicklerBytestrTests, CPicklerBytesFallbackTests,
CDumpPickle_LoadPickle, DumpPickle_CLoadPickle,
PyPicklerUnpicklerObjectTests,
CPicklerUnpicklerObjectTests,
CDispatchTableTests, CChainDispatchTableTests,
InMemoryPickleTests])
if sys.version_info >= (3, 3):
tests.extend([CDispatchTableTests, CChainDispatchTableTests])
return tests

def test_suite():
Expand Down

0 comments on commit d1beeb2

Please sign in to comment.