MCPcopy
hub / github.com/pallets/flask / test_teardown_on_pop

Function test_teardown_on_pop

tests/test_reqctx.py:16–27  ·  view source on GitHub ↗
(app)

Source from the content-addressed store, hash-verified

14
15
16def test_teardown_on_pop(app):
17 buffer = []
18
19 @app.teardown_request
20 def end_of_request(exception):
21 buffer.append(exception)
22
23 ctx = app.test_request_context()
24 ctx.push()
25 assert buffer == []
26 ctx.pop()
27 assert buffer == [None]
28
29
30def test_teardown_with_previous_exception(app):

Callers

nothing calls this directly

Calls 3

test_request_contextMethod · 0.80
pushMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected