Skip to content

Commit

Permalink
make tests work in 2.6, patch from Tres
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver authored and ctismer committed Jul 5, 2013
1 parent 4215063 commit e3e28cc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/zodbpickle/tests/pickletester_2.py
Expand Up @@ -2,6 +2,7 @@
import StringIO
import cStringIO
import copy_reg
import sys

from test.test_support import TestFailed, have_unicode, TESTFN
try:
Expand Down Expand Up @@ -1025,6 +1026,21 @@ def test_attribute_name_interning(self):
for x_key, y_key in zip(x_keys, y_keys):
self.assertIs(x_key, y_key)

if sys.version_info < (2, 7):

def assertIs(self, expr1, expr2, msg=None):
self.assertTrue(expr1 is expr2, msg)

def assertIn(self, expr1, expr2, msg=None):
self.assertTrue(expr1 in expr2, msg)

def assertNotIn(self, expr1, expr2, msg=None):
self.assertTrue(expr1 not in expr2, msg)

AbstractPickleTests.assertIs = assertIs
AbstractPickleTests.assertIn = assertIn
AbstractPickleTests.assertNotIn = assertNotIn


# Test classes for reduce_ex

Expand Down

0 comments on commit e3e28cc

Please sign in to comment.