Commit b3048ed1 authored by Jérome Perrin's avatar Jérome Perrin Committed by Kazuhiko Shiozaki

ERP5TypeTestCase: backport python3 assertion method names

so that we can run 2to3.fix_assert
parent d332f6c8
......@@ -679,6 +679,15 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase):
self.assertEqual(method(), reference_workflow_state)
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):
"""Invoke debugger"""
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