#NEWLINE# def test_unhandled_error_from_deferred( self ) : #NEWLINE# #INDENT# class SomeCase ( TestCase ) : #NEWLINE# #INDENT# def test_cruft( self ) : #NEWLINE# #INDENT# defer . maybeDeferred ( ( lambda : ( 1 / 0 ) ) ) #NEWLINE# defer . maybeDeferred ( ( lambda : ( 2 / 0 ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# test = SomeCase ( 'test_cruft' ) #NEWLINE# runner = self . make_runner ( test ) #NEWLINE# result = self . make_result ( ) #NEWLINE# runner . run ( result ) #NEWLINE# error = result . _events [ 1 ] [ 2 ] #NEWLINE# result . _events [ 1 ] = ( 'addError' , test , None ) #NEWLINE# self . assertThat ( result . _events , Equals ( [ ( 'startTest' , test ) , ( 'addError' , test , None ) , ( 'stopTest' , test ) ] ) ) #NEWLINE# self . assertThat ( error , KeysEqual ( 'twisted-log' , 'unhandled-error-in-deferred' , 'unhandled-error-in-deferred-1' ) )