#NEWLINE# def run_test_for_event( self , event ) : #NEWLINE# #INDENT# 'Tests that an exception raised in response to the given event is\n        handled OK.' #NEWLINE# self . raiseOnEvent = event #NEWLINE# try : #NEWLINE# #INDENT# for i in range ( ( sys . getrecursionlimit ( ) + 1 ) ) : #NEWLINE# #INDENT# sys . settrace ( event . trace ) #NEWLINE# try : #NEWLINE# #INDENT# self . f ( ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . fail ( 'exception not raised!' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except RuntimeError : #NEWLINE# #INDENT# self . fail ( 'recursion counter not reset' )