fix more tests for Python 2.6
This commit is contained in:
parent
2c25966dd6
commit
7f3550f93d
2 changed files with 12 additions and 3 deletions
|
|
@ -102,7 +102,7 @@ class TestIntrinsic(unittest.TestCase):
|
|||
|
||||
golden = math.sin(1.234)
|
||||
answer = retval.as_real(Type.float())
|
||||
self.assertLess(abs(answer-golden)/golden, 1e-5)
|
||||
self.assertTrue(abs(answer-golden)/golden < 1e-5)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# Tests accessing of instruction operands.
|
||||
import sys
|
||||
import logging
|
||||
import unittest
|
||||
|
||||
from llvm.core import *
|
||||
try:
|
||||
|
|
@ -8,8 +11,6 @@ try:
|
|||
except ImportError:
|
||||
from io import StringIO
|
||||
|
||||
import logging, unittest
|
||||
|
||||
m = None
|
||||
|
||||
#===----------------------------------------------------------------------===
|
||||
|
|
@ -32,6 +33,14 @@ entry:
|
|||
"""
|
||||
|
||||
class TestOperands(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 test_operands(self):
|
||||
m = Module.from_assembly(StringIO(test_module))
|
||||
logging.debug("-"*60)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue