Skip to content

Commit

Permalink
The zope.testrunner picked up too much, since the abstract tests were
Browse files Browse the repository at this point in the history
already test cases. Now all tests pass.
  • Loading branch information
Stephan Richter committed Feb 15, 2013
1 parent 0c6b796 commit 694c4e1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/zodbpickle/tests/pickletester.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def create_data():
x.append(5)
return x

class AbstractPickleTests(unittest.TestCase):
class AbstractPickleTests:
# Subclass must define self.dumps, self.loads.

_testdata = create_data()
Expand Down Expand Up @@ -1206,7 +1206,7 @@ def test_negative_32b_binput(self):
self.assertRaises(ValueError, self.loads, dumped)


class BigmemPickleTests(unittest.TestCase):
class BigmemPickleTests:

# Binary protocols can serialize longs of up to 2GB-1

Expand Down Expand Up @@ -1370,7 +1370,7 @@ def __getattr__(self, key):
self.foo


class AbstractPickleModuleTests(unittest.TestCase):
class AbstractPickleModuleTests:

def test_dump_closed_file(self):
import os
Expand Down Expand Up @@ -1430,7 +1430,7 @@ def test_bad_input(self):
self.assertRaises(EOFError, pickle.loads, s)


class AbstractPersistentPicklerTests(unittest.TestCase):
class AbstractPersistentPicklerTests:

# This class defines persistent_id() and persistent_load()
# functions that should be used by the pickler. All even integers
Expand Down Expand Up @@ -1466,7 +1466,7 @@ def test_bin_persistence(self):
self.assertEqual(self.load_count, 5)


class AbstractPicklerUnpicklerObjectTests(unittest.TestCase):
class AbstractPicklerUnpicklerObjectTests:

pickler_class = None
unpickler_class = None
Expand Down Expand Up @@ -1629,7 +1629,7 @@ def __reduce__(self):
class BBB(object):
pass

class AbstractDispatchTableTests(unittest.TestCase):
class AbstractDispatchTableTests:

def test_default_dispatch_table(self):
# No dispatch_table attribute by default
Expand Down
15 changes: 9 additions & 6 deletions src/zodbpickle/tests/test_pickle.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pickle
import io
import collections
import unittest

from test import support

Expand All @@ -11,18 +11,20 @@
from .pickletester import AbstractDispatchTableTests
from .pickletester import BigmemPickleTests

from zodbpickle import pickle

try:
import _pickle
from zodbpickle import _pickle
has_c_implementation = True
except ImportError:
has_c_implementation = False


class PickleTests(AbstractPickleModuleTests):
class PickleTests(AbstractPickleModuleTests, unittest.TestCase):
pass


class PyPicklerTests(AbstractPickleTests):
class PyPicklerTests(AbstractPickleTests, unittest.TestCase):

pickler = pickle._Pickler
unpickler = pickle._Unpickler
Expand All @@ -40,7 +42,8 @@ def loads(self, buf, **kwds):
return u.load()


class InMemoryPickleTests(AbstractPickleTests, BigmemPickleTests):
class InMemoryPickleTests(AbstractPickleTests, BigmemPickleTests,
unittest.TestCase):

pickler = pickle._Pickler
unpickler = pickle._Unpickler
Expand All @@ -52,7 +55,7 @@ def loads(self, buf, **kwds):
return pickle.loads(buf, **kwds)


class PyPersPicklerTests(AbstractPersistentPicklerTests):
class PyPersPicklerTests(AbstractPersistentPicklerTests, unittest.TestCase):

pickler = pickle._Pickler
unpickler = pickle._Unpickler
Expand Down

0 comments on commit 694c4e1

Please sign in to comment.