#NEWLINE# def _instrument_result( logger , result ) : #NEWLINE# #INDENT# old_startTest = result . startTest #NEWLINE# old_addError = result . addError #NEWLINE# old_addFailure = result . addFailure #NEWLINE# def startTest( self , test ) : #NEWLINE# #INDENT# self . test_names . append ( test ) #NEWLINE# self . logger . debug ( 'starting %s' , test ) #NEWLINE# old_startTest ( test ) #NEWLINE# #UNINDENT# def addError( self , test , err ) : #NEWLINE# #INDENT# ( exception_type , exception , traceback ) = err #NEWLINE# self . failed_test_names_and_reasons [ test ] = '{0}: {1}' . format ( exception_type , exception ) . replace ( "'" , '' ) #NEWLINE# old_addError ( test , err ) #NEWLINE# #UNINDENT# def addFailure( self , test , err ) : #NEWLINE# #INDENT# ( exception_type , exception , traceback ) = err #NEWLINE# self . failed_test_names_and_reasons [ test ] = '{0}: {1}' . format ( exception_type , exception ) . replace ( "'" , '' ) #NEWLINE# old_addFailure ( test , err ) #NEWLINE# #UNINDENT# result . startTest = MethodType ( startTest , result ) #NEWLINE# result . addError = MethodType ( addError , result ) #NEWLINE# result . addFailure = MethodType ( addFailure , startTest ) #NEWLINE# result . test_names = [ ] #NEWLINE# result . failed_test_names_and_reasons = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# result . logger = logger #NEWLINE# return result