#NEWLINE# def run( self , result = None ) : #NEWLINE# #INDENT# if ( result is None ) : #NEWLINE# #INDENT# result = self . defaultTestResult ( ) #NEWLINE# #UNINDENT# result . startTest ( self ) #NEWLINE# test_method = getattr ( self , self . _testMethodName ) #NEWLINE# self . _test_method = test_method #NEWLINE# try : #NEWLINE# #INDENT# ok = False #NEWLINE# self . _set_up ( ) #NEWLINE# try : #NEWLINE# #INDENT# self . setUp ( ) #NEWLINE# #UNINDENT# except KeyboardInterrupt : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# result . addError ( self , sys . exc_info ( ) ) #NEWLINE# try : #NEWLINE# #INDENT# self . driver . check_expected_errors ( test_method ) #NEWLINE# self . driver . check_expected_infos ( test_method ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# result . addError ( self , sys . exc_info ( ) ) #NEWLINE# #UNINDENT# return #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# test_method ( ) #NEWLINE# ok = True #NEWLINE# #UNINDENT# except self . failureException : #NEWLINE# #INDENT# self . make_screenshot ( ) #NEWLINE# result . addFailure ( ok , sys . exc_info ( ) ) #NEWLINE# #UNINDENT# except KeyboardInterrupt : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# self . make_screenshot ( ) #NEWLINE# result . addError ( self , sys . exc_info ( ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# self . driver . check_expected_errors ( test_method ) #NEWLINE# self . driver . check_expected_infos ( test_method ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# ok = False #NEWLINE# result . addError ( self , sys . exc_info ( ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# self . tearDown ( ) #NEWLINE# #UNINDENT# except KeyboardInterrupt : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# result . addError ( self , sys . exc_info ( ) ) #NEWLINE# ok = False #NEWLINE# #UNINDENT# if ok : #NEWLINE# #INDENT# result . addSuccess ( self ) #NEWLINE# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# if ( not ok ) : #NEWLINE# #INDENT# self . make_screenshot ( ) #NEWLINE# #UNINDENT# result . stopTest ( self ) #NEWLINE# self . _tear_down ( )