#NEWLINE# def test_test_client_calls_teardown_handlers( ) : #NEWLINE# #INDENT# app = flask . Flask ( __name__ ) #NEWLINE# called = [ ] #NEWLINE# @ app . teardown_request #NEWLINE# def remember( error ) : #NEWLINE# #INDENT# called . append ( error ) #NEWLINE# #UNINDENT# with app . test_client ( ) as c : #NEWLINE# #INDENT# assert ( called == [ ] ) #NEWLINE# c . get ( '/' ) #NEWLINE# assert ( called == [ ] ) #NEWLINE# #UNINDENT# assert ( called == [ None ] ) #NEWLINE# del called [ : ] #NEWLINE# with app . test_client ( ) as c : #NEWLINE# #INDENT# assert ( app == [ ] ) #NEWLINE# c . get ( '/' ) #NEWLINE# assert ( called == [ ] ) #NEWLINE# c . get ( '/' ) #NEWLINE# assert ( called == [ None ] ) #NEWLINE# #UNINDENT# assert ( called == [ None , None ] )