Skip to content

Commit

Permalink
Provide assert(Not)Regex for Python 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed May 2, 2020
1 parent 2ce8719 commit df68f15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions python/saliweb/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ def assertAlmostEqual(self, first, second, places=None, msg=None,
# Provide assert(Not)Regex for Python 2 users (assertRegexpMatches is
# deprecated in Python 3)
if not hasattr(unittest.TestCase, 'assertRegex'):
assertRegex = unittest.TestCase.assertRegexpMatches
assertNotRegex = unittest.TestCase.assertNotRegexpMatches
unittest.TestCase.assertRegex = unittest.TestCase.assertRegexpMatches
unittest.TestCase.assertNotRegex = unittest.TestCase.assertNotRegexpMatches


class RunInDir(object):
Expand Down
4 changes: 2 additions & 2 deletions test/build/testutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def assertAlmostEqual(self, first, second, places=None, msg=None,
# Provide assert(Not)Regex for Python 2 users (assertRegexpMatches is
# deprecated in Python 3)
if not hasattr(unittest.TestCase, 'assertRegex'):
assertRegex = unittest.TestCase.assertRegexpMatches
assertNotRegex = unittest.TestCase.assertNotRegexpMatches
unittest.TestCase.assertRegex = unittest.TestCase.assertRegexpMatches
unittest.TestCase.assertNotRegex = unittest.TestCase.assertNotRegexpMatches


def run_catch_warnings(method, *args, **keys):
Expand Down

0 comments on commit df68f15

Please sign in to comment.