#NEWLINE# def test_log_err_flushed_is_success( self ) : #NEWLINE# #INDENT# class LogAnError ( TestCase ) : #NEWLINE# #INDENT# def test_something( self ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ( 1 / 0 ) #NEWLINE# #UNINDENT# except ZeroDivisionError : #NEWLINE# #INDENT# f = failure . Failure ( ) #NEWLINE# #UNINDENT# log . err ( f ) #NEWLINE# flush_logged_errors ( ZeroDivisionError ) #NEWLINE# #UNINDENT# #UNINDENT# test = LogAnError ( 'test_something' ) #NEWLINE# runner = self . make_runner ( test ) #NEWLINE# result = self . make_result ( ) #NEWLINE# runner . run ( test ) #NEWLINE# self . assertThat ( result . _events , Equals ( [ ( 'startTest' , test ) , ( 'addSuccess' , test , { #NEWLINE# #INDENT# 'twisted-log' : text_content ( '' ) , #NEWLINE# #UNINDENT# } ) , ( 'stopTest' , test ) ] ) )