def _assertRaisesRegexp(self, expected_exception, expected_regexp, callable_obj, *args, **kwds):
 exception = None
 try:
  callable_obj(*args, **kwds)
 except expected_exception as ex:
  exception = ex
 if (exception is None):
  self.fail(('%s not raised' % str(expected_exception.__name__)))
 if isinstance(expected_regexp, string_types):
  expected_regexp = re.compile(expected_regexp)
 if (not expected_regexp.search(str(exception))):
  self.fail(('"%s" does not match "%s"' % (expected_regexp.pattern, str(exception))))

def _assertRaisesRegexp ( self , expected_exception , expected_regexp , callable_obj , * args , ** kwds ) : exception = None try : callable_obj ( * args , ** kwds ) except expected_exception as ex : exception = ex if ( exception is None ) : self . fail ( ( '%s not raised' % str ( expected_exception . __name__ ) ) ) if isinstance ( expected_regexp , string_types ) : expected_regexp = re . compile ( expected_regexp ) if ( not expected_regexp . search ( str ( exception ) ) ) : self . fail ( ( '"%s" does not match "%s"' % ( expected_regexp . pattern , str ( exception ) ) ) )
asserts that the message in a raised exception matches a regexp .