diff --git a/src/quart/app.py b/src/quart/app.py index 879440c..c9d68fb 100644 --- a/src/quart/app.py +++ b/src/quart/app.py @@ -21,7 +21,6 @@ Optional, overload, TypeVar, - Union, ) from urllib.parse import quote from weakref import WeakSet @@ -41,6 +40,7 @@ from .asgi import ASGIHTTPConnection, ASGILifespan, ASGIWebsocketConnection from .cli import AppGroup +from .config import Config from .ctx import ( _AppCtxGlobals, AppContext, @@ -207,6 +207,7 @@ class Quart(App): test_client_class: type[TestClientProtocol] # type: ignore[assignment] aborter_class = Aborter + config_class = Config app_ctx_globals_class = _AppCtxGlobals asgi_http_class = ASGIHTTPConnection asgi_lifespan_class = ASGILifespan @@ -1100,7 +1101,7 @@ def ensure_async(self, func: Callable[P, T]) -> Callable[P, Awaitable[T]]: ... def ensure_async( - self, func: Union[Callable[P, Awaitable[T]], Callable[P, T]] + self, func: Callable[P, Awaitable[T]] | Callable[P, T] ) -> Callable[P, Awaitable[T]]: """Ensure that the returned func is async and calls the func. diff --git a/tests/test_app.py b/tests/test_app.py index 02f012d..19fb4c3 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -11,6 +11,7 @@ from werkzeug.wrappers import Response as WerkzeugResponse from quart.app import Quart +from quart.config import Config from quart.globals import session, websocket from quart.sessions import SecureCookieSession, SessionInterface from quart.testing import no_op_push, WebsocketResponseError @@ -408,3 +409,8 @@ async def index() -> str: assert serving == [1] assert shutdown assert serving == [1, 2] + + +def test_app_config_class() -> None: + app = Quart(__name__) + assert isinstance(app.config, Config)