Home / Function/ test_async_view() — flask Function Reference

test_async_view() — flask Function Reference

Architecture documentation for the test_async_view() function in test_helpers.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  8ab12aac_112d_9251_1183_9266c865cb37["test_async_view()"]
  76c30621_3053_d7e5_0aa1_daf0facdcd3e["TestStreaming"]
  8ab12aac_112d_9251_1183_9266c865cb37 -->|defined in| 76c30621_3053_d7e5_0aa1_daf0facdcd3e
  729b2b4d_9ff1_7f6f_84a8_82111621cd27["get()"]
  8ab12aac_112d_9251_1183_9266c865cb37 -->|calls| 729b2b4d_9ff1_7f6f_84a8_82111621cd27
  aeed6e85_d75e_4caa_702e_8017da7792a4["close()"]
  8ab12aac_112d_9251_1183_9266c865cb37 -->|calls| aeed6e85_d75e_4caa_702e_8017da7792a4
  style 8ab12aac_112d_9251_1183_9266c865cb37 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_helpers.py lines 309–330

    def test_async_view(self, app, client):
        @app.route("/")
        async def index():
            flask.session["test"] = "flask"

            @flask.stream_with_context
            def gen():
                yield flask.session["test"]

            return flask.Response(gen())

        # response is closed without reading stream
        client.get().close()
        # response stream is read
        assert client.get().text == "flask"

        # same as above, but with client context preservation
        with client:
            client.get().close()

        with client:
            assert client.get().text == "flask"

Subdomains

Calls

Frequently Asked Questions

What does test_async_view() do?
test_async_view() is a function in the flask codebase, defined in tests/test_helpers.py.
Where is test_async_view() defined?
test_async_view() is defined in tests/test_helpers.py at line 309.
What does test_async_view() call?
test_async_view() calls 2 function(s): close, get.

Analyze Your Own Codebase

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

Try Supermodel Free