- Sort Score
- Num 10 results
- Language All
Results 1 - 5 of 5 for client_fixture (0.09 seconds)
-
tests/test_stringified_annotation_dependency.py
client = DummyClient() yield client await client.close() Client = Annotated[DummyClient, Depends(get_client)] @pytest.fixture(name="client") def client_fixture() -> TestClient: app = FastAPI() @app.get("/") async def get_people(client: Client) -> list: return await client.get_people() client = TestClient(app) return client
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 2.2K bytes - Click Count (0) -
tests/test_security_scopes.py
db: Annotated[str, Depends(get_db)], user: Annotated[str, Security(get_user, scopes=["read"])], ): return {"db": db} return app @pytest.fixture(name="client") def client_fixture(app: FastAPI): return TestClient(app) def test_security_scopes_dependency_called_once( client: TestClient, call_counter: dict[str, int] ): response = client.get("/")
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 1006 bytes - Click Count (0) -
tests/test_security_scopes_sub_dependency.py
): return { "user_me": user_me, "user_items": user_items, } return app @pytest.fixture(name="client") def client_fixture(app: FastAPI): return TestClient(app) def test_security_scopes_sub_dependency_caching( client: TestClient, call_counts: dict[str, int] ): response = client.get("/")Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 2.9K bytes - Click Count (0) -
tests/test_get_model_definitions_formfeed_escape.py
import pytest from fastapi import FastAPI from fastapi.testclient import TestClient from inline_snapshot import snapshot @pytest.fixture(name="client") def client_fixture() -> TestClient: from pydantic import BaseModel class Address(BaseModel): """ This is a public description of an Address \f You can't see this part of the docstring, it's private! """ line_1: str
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Feb 04 14:34:02 GMT 2026 - 6K bytes - Click Count (0) -
tests/test_sse.py
async def stream_events(): yield {"msg": "hello"} yield {"msg": "world"} app.include_router(router, prefix="/api") @pytest.fixture(name="client") def client_fixture(): with TestClient(app) as c: yield c def test_async_generator_with_model(client: TestClient): response = client.get("/items/stream") assert response.status_code == 200
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 01 09:21:52 GMT 2026 - 9.8K bytes - Click Count (0)