def assert_raises_regex(exception_class, expected_regexp, callable_obj=None, *args, **kwargs):
 __tracebackhide__ = True
 nose = import_nose()
 if (sys.version_info.major >= 3):
  funcname = nose.tools.assert_raises_regex
 else:
  funcname = nose.tools.assert_raises_regexp
 return funcname(exception_class, expected_regexp, callable_obj, *args, **kwargs)

def assert_raises_regex ( exception_class , expected_regexp , callable_obj = None , * args , ** kwargs ) : __tracebackhide__ = True nose = import_nose ( ) if ( sys . version_info . major >= 3 ) : funcname = nose . tools . assert_raises_regex else : funcname = nose . tools . assert_raises_regexp return funcname ( exception_class , expected_regexp , callable_obj , * args , ** kwargs )
assert that some exception is raised in a context and that the message matches some pattern .