MCPcopy Create free account
hub / github.com/pallets/flask / test_after_request_processing

Function test_after_request_processing

tests/test_basic.py:733–745  ·  view source on GitHub ↗
(app, client)

Source from the content-addressed store, hash-verified

731
732
733def test_after_request_processing(app, client):
734 @app.route("/")
735 def index():
736 @flask.after_this_request
737 def foo(response):
738 response.headers["X-Foo"] = "a header"
739 return response
740
741 return "Test"
742
743 resp = client.get("/")
744 assert resp.status_code == 200
745 assert resp.headers["X-Foo"] == "a header"
746
747
748def test_teardown_request_handler(app, client):

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected