diff --git a/fastapi/routing.py b/fastapi/routing.py index 29b29977b..24c5277d3 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -6,19 +6,19 @@ import json from contextlib import AsyncExitStack, asynccontextmanager from enum import Enum, IntEnum from typing import ( - AsyncIterator, Any, + AsyncIterator, Callable, Coroutine, Dict, List, + Mapping, Optional, Sequence, Set, Tuple, Type, Union, - Mapping, ) from fastapi import params @@ -59,7 +59,7 @@ from starlette.routing import ( websocket_session, ) from starlette.status import WS_1008_POLICY_VIOLATION -from starlette.types import ASGIApp, Lifespan, Scope, AppType +from starlette.types import AppType, ASGIApp, Lifespan, Scope from starlette.websockets import WebSocket diff --git a/tests/test_router_events.py b/tests/test_router_events.py index 440b4b469..2b679ba64 100644 --- a/tests/test_router_events.py +++ b/tests/test_router_events.py @@ -120,7 +120,7 @@ def test_router_nested_lifespan_state(state: State) -> None: state.router_startup = True yield state.router_shutdown = True - + @asynccontextmanager async def subrouter_lifespan(app: FastAPI) -> AsyncGenerator[None, None]: state.sub_router_startup = True