diff --git a/microbootstrap/bootstrappers/fastapi.py b/microbootstrap/bootstrappers/fastapi.py index 54d154a..b4df53b 100644 --- a/microbootstrap/bootstrappers/fastapi.py +++ b/microbootstrap/bootstrappers/fastapi.py @@ -46,11 +46,11 @@ async def _wrapped_lifespan_manager(self, app: fastapi.FastAPI) -> typing.AsyncI def _choose_lifespan_manager( self, - ) -> typing.Callable[[fastapi.FastAPI], typing.AsyncIterator[dict[str, typing.Any]]]: + ) -> typing.Callable[[fastapi.FastAPI], typing.AsyncContextManager[dict[str, typing.Any]]]: if self.application_config.lifespan: - return self._wrapped_lifespan_manager # type: ignore[return-value] + return self._wrapped_lifespan_manager - return self._lifespan_manager # type: ignore[return-value] + return self._lifespan_manager def bootstrap_before(self) -> dict[str, typing.Any]: return {