#NEWLINE# def test_request_exception_signal( ) : #NEWLINE# #INDENT# app = flask . Flask ( __name__ ) #NEWLINE# recorded = [ ] #NEWLINE# @ app . route ( '/' ) #NEWLINE# def index( ) : #NEWLINE# #INDENT# ( 1 // 0 ) #NEWLINE# #UNINDENT# def record( sender , exception ) : #NEWLINE# #INDENT# recorded . append ( exception ) #NEWLINE# #UNINDENT# flask . got_request_exception . connect ( record , app ) #NEWLINE# try : #NEWLINE# #INDENT# assert ( app . test_client ( ) . get ( '/' ) . status_code == 500 ) #NEWLINE# assert ( len ( recorded ) == 1 ) #NEWLINE# assert isinstance ( recorded [ 0 ] , ZeroDivisionError ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# flask . got_request_exception . disconnect ( record , app )