Home / Function/ test_appcontext_signals() — flask Function Reference

test_appcontext_signals() — flask Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  4f156636_ce03_7b7c_3f16_8e36489cac97["test_appcontext_signals()"]
  c3b1a87e_8010_360c_4ba2_299da688358e["test_signals.py"]
  4f156636_ce03_7b7c_3f16_8e36489cac97 -->|defined in| c3b1a87e_8010_360c_4ba2_299da688358e
  style 4f156636_ce03_7b7c_3f16_8e36489cac97 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_signals.py lines 115–136

def test_appcontext_signals(app, client):
    recorded = []

    def record_push(sender, **kwargs):
        recorded.append("push")

    def record_pop(sender, **kwargs):
        recorded.append("pop")

    @app.route("/")
    def index():
        return "Hello"

    flask.appcontext_pushed.connect(record_push, app)
    flask.appcontext_popped.connect(record_pop, app)
    try:
        rv = client.get("/")
        assert rv.data == b"Hello"
        assert recorded == ["push", "pop"]
    finally:
        flask.appcontext_pushed.disconnect(record_push, app)
        flask.appcontext_popped.disconnect(record_pop, app)

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free