def raises_regex ( self , expected_exception , expected_regexp ) : return unittest_case . assertRaisesRegexp ( expected_exception , expected_regexp , self . _orig_subject , * self . _args , * * self . _kwargs )
python unittest assertregex caseinsesitive
Ensures preceding predicates ( specifically : meth : called_with () ) result in * expected_exception * being raised and the string representation of * expected_exception * must match regular expression * expected_regexp * .
def raises_regex(self, expected_exception, expected_regexp):
        """
        Ensures preceding predicates (specifically, :meth:`called_with()`) result in *expected_exception* being raised,
        and the string representation of *expected_exception* must match regular expression *expected_regexp*.
        """
        return unittest_case.assertRaisesRegexp(expected_exception, expected_regexp, self._orig_subject,
                                                *self._args, **self._kwargs)