Commit b990a75a authored by Jérome Perrin's avatar Jérome Perrin

ERP5TypeTestCase: backport python3 assertion method names

so that we can run 2to3.fix_assert
parent cd1b212d
...@@ -679,6 +679,15 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase): ...@@ -679,6 +679,15 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase):
self.assertEqual(method(), reference_workflow_state) self.assertEqual(method(), reference_workflow_state)
return workflow_error_message return workflow_error_message
# BBB backport methods from python3.
# We use this tricky getattr syntax so that lib2to3.fixers.fix_asserts
# do not fix this code.
if six.PY2:
def assertRaisesRegex(self, *args, **kwargs):
return getattr(self, 'assertRaisesRegexp')(*args, **kwargs)
def assertRegex(self, *args, **kwargs):
return getattr(self, 'assertRegexpMatches')(*args, **kwargs)
def stepPdb(self, sequence=None, sequence_list=None): def stepPdb(self, sequence=None, sequence_list=None):
"""Invoke debugger""" """Invoke debugger"""
try: # try ipython if available try: # try ipython if available
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment