#NEWLINE# def assertRaisesRegexp( self , exc_class , pattern , callable_obj , * args , **kwargs ) : #NEWLINE# #INDENT# class ReRaiseOtherTypes ( object ) : #NEWLINE# #INDENT# def match( self , matchee ) : #NEWLINE# #INDENT# if ( not issubclass ( matchee [ 0 ] , exc_class ) ) : #NEWLINE# #INDENT# compat . reraise ( * matchee ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# class CaptureMatchee ( object ) : #NEWLINE# #INDENT# def match( self , matchee ) : #NEWLINE# #INDENT# self . matchee = matchee [ 1 ] #NEWLINE# #UNINDENT# #UNINDENT# capture = CaptureMatchee ( ) #NEWLINE# matcher = matchers . Raises ( matchers . MatchesAll ( ReRaiseOtherTypes ( ) , matchers . MatchesException ( exc_class , pattern ) , capture ) ) #NEWLINE# our_callable = testcase . Nullary ( callable_obj , * kwargs , ** kwargs ) #NEWLINE# self . assertThat ( our_callable , matcher ) #NEWLINE# return capture . matchee