diff --git a/test/objcache.py b/test/objcache.py index 7342439..996ba47 100755 --- a/test/objcache.py +++ b/test/objcache.py @@ -2,9 +2,23 @@ from llvm.core import * -import logging, unittest +import logging, sys, unittest class TestObjCache(unittest.TestCase): + + if sys.version_info[:2] < (2, 7): + def assertIs(self, expr1, expr2, msg=None): + if expr1 is not expr2: + standardMsg = '%s is not %s' % (safe_repr(expr1), + safe_repr(expr2)) + self.fail(self._formatMessage(msg, standardMsg)) + + def assertIsNot(self, expr1, expr2, msg=None): + if expr1 is expr2: + standardMsg = 'unexpectedly identical: %s' % (safe_repr( + expr1),) + self.fail(self._formatMessage(msg, standardMsg)) + def test_objcache(self): logging.debug("Testing module aliasing ..") m1 = Module.new('a')