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

Function test_teardown_with_handled_exception

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

Source from the content-addressed store, hash-verified

45
46
47def test_teardown_with_handled_exception(app):
48 buffer = []
49
50 @app.teardown_request
51 def end_of_request(exception):
52 buffer.append(exception)
53
54 with app.test_request_context():
55 assert buffer == []
56 try:
57 raise Exception("dummy")
58 except Exception:
59 pass
60 assert buffer == [None]
61
62
63def test_proper_test_request_context(app):

Callers

nothing calls this directly

Calls 1

test_request_contextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…