- Sort Score
- Result 10 results
- Languages All
Results 1 - 6 of 6 for AsyncGenerator (0.05 sec)
-
tests/test_router_events.py
@asynccontextmanager async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]: yield @asynccontextmanager async def router_lifespan(app: FastAPI) -> AsyncGenerator[dict[str, bool], None]: yield {"router": True} @asynccontextmanager async def sub_router_lifespan(app: FastAPI) -> AsyncGenerator[None, None]: yieldRegistered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 7.3K bytes - Viewed (0) -
tests/test_dependency_partial.py
from collections.abc import AsyncGenerator, Generator from functools import partial from typing import Annotated import pytest from fastapi import Depends, FastAPI from fastapi.testclient import TestClient app = FastAPI() def function_dependency(value: str) -> str: return value async def async_function_dependency(value: str) -> str: return value def gen_dependency(value: str) -> Generator[str, None, None]:
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 6.3K bytes - Viewed (0) -
fastapi/concurrency.py
from collections.abc import AsyncGenerator from contextlib import AbstractContextManager from contextlib import asynccontextmanager as asynccontextmanager from typing import TypeVar import anyio.to_thread from anyio import CapacityLimiter from starlette.concurrency import iterate_in_threadpool as iterate_in_threadpool # noqa from starlette.concurrency import run_in_threadpool as run_in_threadpool # noqa from starlette.concurrency import ( # noqa
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 1.5K bytes - Viewed (0) -
tests/test_dependency_class.py
from collections.abc import AsyncGenerator, Generator import pytest from fastapi import Depends, FastAPI from fastapi.testclient import TestClient app = FastAPI() class CallableDependency: def __call__(self, value: str) -> str: return value class CallableGenDependency: def __call__(self, value: str) -> Generator[str, None, None]: yield value class AsyncCallableDependency:
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 4.4K bytes - Viewed (0) -
tests/test_stringified_annotation_dependency.py
from inline_snapshot import snapshot if TYPE_CHECKING: # pragma: no cover from collections.abc import AsyncGenerator class DummyClient: async def get_people(self) -> list: return ["John Doe", "Jane Doe"] async def close(self) -> None: pass async def get_client() -> AsyncGenerator[DummyClient, None]: client = DummyClient() yield client await client.close()Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 2.2K bytes - Viewed (0) -
tests/test_dependency_wrapped.py
import inspect import sys from collections.abc import AsyncGenerator, Generator from functools import wraps import pytest from fastapi import Depends, FastAPI from fastapi.concurrency import iterate_in_threadpool, run_in_threadpool from fastapi.testclient import TestClient if sys.version_info >= (3, 13): # pragma: no cover from inspect import iscoroutinefunction else: # pragma: no cover from asyncio import iscoroutinefunction
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 11.2K bytes - Viewed (0)