tests: Add unittest aliases to Python 2.7
This commit is contained in:
committed by
Adrien Vergé
parent
11b1f1c14e
commit
cef0b48993
@@ -71,6 +71,11 @@ class CommandLineTestCase(unittest.TestCase):
|
||||
def setUpClass(cls):
|
||||
super(CommandLineTestCase, cls).setUpClass()
|
||||
|
||||
# https://docs.python.org/3/library/unittest.html#deprecated-aliases
|
||||
if sys.version_info < (3, 2):
|
||||
cls.assertRegex = cls.assertRegexpMatches
|
||||
cls.assertRaisesRegex = cls.assertRaisesRegexp
|
||||
|
||||
cls.wd = build_temp_workspace({
|
||||
# .yaml file at root
|
||||
'a.yaml': '---\n'
|
||||
|
||||
Reference in New Issue
Block a user