Skip to content

Instantly share code, notes, and snippets.

@alexanderjulo
Created September 2, 2012 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexanderjulo/3604408 to your computer and use it in GitHub Desktop.
Save alexanderjulo/3604408 to your computer and use it in GitHub Desktop.
% python test.py
teardown request.
teardown app context.
%
from flask import Flask
app = Flask(__name__)
@app.route('/')
def test():
return 'Yep.'
@app.after_request
def after_request(response):
print "after request."
return response
@app.teardown_request
def teardown_request(response):
print "teardown request."
return response
@app.teardown_appcontext
def teardown_appcontext(response):
print "teardown app context."
return response
with app.test_request_context('/'):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment