Skip to content
Myr

Add further typing tests

Before adoption: this commit came in with the history the project adopted, so no landing records it.

This should help ensure the app decorators are correctly typed.

authored by pgjones · committed by pgjones · parent 9b44bf2 · Browse files · 1 file+38 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+38 added−0 removed

  • tests:+38 added−0 removed

1 file+38 added−0 removed

added:tests/typing/typing_app_decorators.py+38 added
1from __future__ import annotations23import typing as t45from flask import Flask6from flask import Response78app = Flask(__name__)91011@app.after_request12def after_sync(response: Response) -> Response:13 ...141516@app.after_request17async def after_async(response: Response) -> Response:18 ...192021@app.before_request22def before_sync() -> None:23 ...242526@app.before_request27async def before_async() -> None:28 ...293031@app.teardown_appcontext32def teardown_sync(exc: t.Optional[BaseException]) -> None:33 ...343536@app.teardown_appcontext37async def teardown_async(exc: t.Optional[BaseException]) -> None:38 ...