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

Function test_teardown_with_previous_exception

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

Source from the content-addressed store, hash-verified

28
29
30def test_teardown_with_previous_exception(app):
31 buffer = []
32
33 @app.teardown_request
34 def end_of_request(exception):
35 buffer.append(exception)
36
37 try:
38 raise Exception("dummy")
39 except Exception:
40 pass
41
42 with app.test_request_context():
43 assert buffer == []
44 assert buffer == [None]
45
46
47def test_teardown_with_handled_exception(app):

Callers

nothing calls this directly

Calls 1

test_request_contextMethod · 0.80

Tested by

no test coverage detected