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

Function test_clean_pop

tests/test_appctx.py:193–209  ·  view source on GitHub ↗
(app)

Source from the content-addressed store, hash-verified

191
192
193def test_clean_pop(app):
194 app.testing = False
195 called = []
196
197 @app.teardown_request
198 def teardown_req(error=None):
199 raise ZeroDivisionError
200
201 @app.teardown_appcontext
202 def teardown_app(error=None):
203 called.append("TEARDOWN")
204
205 with app.app_context():
206 called.append(flask.current_app.name)
207
208 assert called == ["flask_test", "TEARDOWN"]
209 assert not flask.current_app

Callers

nothing calls this directly

Calls 1

app_contextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…