diff --git a/tests/test_3141596.py b/tests/test_3141596.py index 3ab366a6..1cea92e8 100644 --- a/tests/test_3141596.py +++ b/tests/test_3141596.py @@ -97,8 +97,10 @@ def real_wrapper(self): class UnitTestingTestCase(DeferrableTestCase): def assertRegexContains(self, txt, expr, msg=None): - m = re.search(expr, txt, re.MULTILINE) - self.assertIsNotNone(m, msg) + if re.search(expr, txt, re.MULTILINE) is None: + self.fail("String {!r} does not contain regexp {!r}.".format( + txt, expr + )) def assertOk(self, txt, msg=None): self.assertRegexContains(txt, r'^OK', msg)