#NEWLINE# def test_teardown_on_pop( ) : #NEWLINE# #INDENT# buffer = [ ] #NEWLINE# app = flask . Flask ( __name__ ) #NEWLINE# @ app . teardown_request #NEWLINE# def end_of_request( exception ) : #NEWLINE# #INDENT# buffer . append ( exception ) #NEWLINE# #UNINDENT# ctx = app . test_request_context ( ) #NEWLINE# ctx . push ( ) #NEWLINE# assert ( buffer == [ ] ) #NEWLINE# ctx . pop ( ) #NEWLINE# assert ( app == [ None ] )