llvm.org GIT mirror llvm / 9d10653
Python compat - assertRaisesRegex Python3 uses assertRaisesRegex instad of assertRaisesRegexp. Differential Revision: https://reviews.llvm.org/D56251 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350308 91177308-0d34-0410-b5e6-96231b3b80d8 Serge Guelton 6 months ago
2 changed file(s) with 6 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
0 import os.path
1 import sys
12 import unittest
3
24
35 POSSIBLE_TEST_BINARIES = [
46 'libreadline.so.5',
1416 ]
1517
1618 class TestBase(unittest.TestCase):
19 if sys.version_info.major == 2:
20 assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
21
1722 def get_test_binary(self):
1823 """Helper to obtain a test binary for object file testing.
1924
1818 self.assertEqual(s, '\tjcxz\t-127')
1919
2020 def test_nonexistent_triple(self):
21 with self.assertRaisesRegexp(Exception, "Could not obtain disassembler for triple"):
21 with self.assertRaisesRegex(Exception, "Could not obtain disassembler for triple"):
2222 Disassembler("nonexistent-triple-raises")
2323
2424 def test_get_instructions(self):