Home / Function/ _async_app() — flask Function Reference

_async_app() — flask Function Reference

Architecture documentation for the _async_app() function in test_async.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  56b83871_ae34_470b_d3bd_c9cbd6a5c1a3["_async_app()"]
  2ca33915_61cb_9ace_26ed_1542aea53eee["test_async.py"]
  56b83871_ae34_470b_d3bd_c9cbd6a5c1a3 -->|defined in| 2ca33915_61cb_9ace_26ed_1542aea53eee
  style 56b83871_ae34_470b_d3bd_c9cbd6a5c1a3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_async.py lines 41–78

def _async_app():
    app = Flask(__name__)

    @app.route("/", methods=["GET", "POST"])
    @app.route("/home", methods=["GET", "POST"])
    async def index():
        await asyncio.sleep(0)
        return request.method

    @app.errorhandler(AppError)
    async def handle(_):
        return "", 412

    @app.route("/error")
    async def error():
        raise AppError()

    blueprint = Blueprint("bp", __name__)

    @blueprint.route("/", methods=["GET", "POST"])
    async def bp_index():
        await asyncio.sleep(0)
        return request.method

    @blueprint.errorhandler(BlueprintError)
    async def bp_handle(_):
        return "", 412

    @blueprint.route("/error")
    async def bp_error():
        raise BlueprintError()

    app.register_blueprint(blueprint, url_prefix="/bp")

    app.add_url_rule("/view", view_func=AsyncView.as_view("view"))
    app.add_url_rule("/methodview", view_func=AsyncMethodView.as_view("methodview"))

    return app

Subdomains

Defined In

Frequently Asked Questions

What does _async_app() do?
_async_app() is a function in the flask codebase, defined in tests/test_async.py.
Where is _async_app() defined?
_async_app() is defined in tests/test_async.py at line 41.

Analyze Your Own Codebase

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

Try Supermodel Free