backporting assertIs and assertIsNot to objcache.py
This commit is contained in:
parent
2fd1e6d056
commit
2c25966dd6
1 changed files with 15 additions and 1 deletions
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue