#NEWLINE# def test_error( self ) : #NEWLINE# #INDENT# '\n        A script that raises an exception exits, logging the error as an\n        ``eliot` message.\n        ' #NEWLINE# d = self . run_script ( FailScript ) #NEWLINE# def got_messages( messages ) : #NEWLINE# #INDENT# assertContainsFields ( self , messages [ 1 ] , { #NEWLINE# #INDENT# 'message_type' : 'twisted:log' , #NEWLINE# 'error' : True , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertTrue ( messages [ 1 ] [ 'message' ] . startswith ( 'Unhandled Error\nTraceback (most recent call last):\n' ) ) #NEWLINE# self . assertTrue ( messages [ 1 ] [ 'message' ] . endswith ( 'ZeroDivisionError: ono\n' ) ) #NEWLINE# #UNINDENT# d . addCallback ( got_messages ) #NEWLINE# return d