Home / Function/ test_app_tearing_down_with_handled_exception_by_app_handler() — flask Function Reference

test_app_tearing_down_with_handled_exception_by_app_handler() — flask Function Reference

Architecture documentation for the test_app_tearing_down_with_handled_exception_by_app_handler() function in test_appctx.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  89d37968_5148_0680_5565_a519b74cea77["test_app_tearing_down_with_handled_exception_by_app_handler()"]
  64d09782_9311_5dea_7886_5faca96ebc84["test_appctx.py"]
  89d37968_5148_0680_5565_a519b74cea77 -->|defined in| 64d09782_9311_5dea_7886_5faca96ebc84
  style 89d37968_5148_0680_5565_a519b74cea77 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_appctx.py lines 90–110

def test_app_tearing_down_with_handled_exception_by_app_handler(app, client):
    app.config["PROPAGATE_EXCEPTIONS"] = True
    cleanup_stuff = []

    @app.teardown_appcontext
    def cleanup(exception):
        cleanup_stuff.append(exception)

    @app.route("/")
    def index():
        raise Exception("dummy")

    @app.errorhandler(Exception)
    def handler(f):
        return flask.jsonify(str(f))

    with app.app_context():
        client.get("/")

    # teardown request context, and with block context
    assert cleanup_stuff == [None, None]

Subdomains

Frequently Asked Questions

What does test_app_tearing_down_with_handled_exception_by_app_handler() do?
test_app_tearing_down_with_handled_exception_by_app_handler() is a function in the flask codebase, defined in tests/test_appctx.py.
Where is test_app_tearing_down_with_handled_exception_by_app_handler() defined?
test_app_tearing_down_with_handled_exception_by_app_handler() is defined in tests/test_appctx.py at line 90.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free