Home / Function/ test_appcontext_tearing_down_signal() — flask Function Reference

test_appcontext_tearing_down_signal() — flask Function Reference

Architecture documentation for the test_appcontext_tearing_down_signal() function in test_signals.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  7e315081_e6b2_5c9e_e16c_3e6c3ea05e1e["test_appcontext_tearing_down_signal()"]
  a3094b63_9b33_613c_f8a0_440ab19800e5["test_signals.py"]
  7e315081_e6b2_5c9e_e16c_3e6c3ea05e1e -->|defined in| a3094b63_9b33_613c_f8a0_440ab19800e5
  style 7e315081_e6b2_5c9e_e16c_3e6c3ea05e1e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_signals.py lines 163–181

def test_appcontext_tearing_down_signal(app, client):
    app.testing = False
    recorded = []

    def record_teardown(sender, exc):
        recorded.append(exc)

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

    flask.appcontext_tearing_down.connect(record_teardown, app)
    try:
        rv = client.get("/")
        assert rv.status_code == 500
        assert len(recorded) == 1
        assert isinstance(recorded[0], ZeroDivisionError)
    finally:
        flask.appcontext_tearing_down.disconnect(record_teardown, app)

Subdomains

Frequently Asked Questions

What does test_appcontext_tearing_down_signal() do?
test_appcontext_tearing_down_signal() is a function in the flask codebase, defined in tests/test_signals.py.
Where is test_appcontext_tearing_down_signal() defined?
test_appcontext_tearing_down_signal() is defined in tests/test_signals.py at line 163.

Analyze Your Own Codebase

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

Try Supermodel Free