testing.client

Page actions AI-ready formats and sharing
Open LLM text
Share with AI
Ask Claude Ask ChatGPT Ask Gemini Ask Copilot

Async test client for chirp applications.

Uses the same Request and Response types as production. No wrapper translation layer.

Runs on_worker_startup / on_worker_shutdown so tests exercise the same code paths as production…

Async test client for chirp applications.

Uses the same Request and Response types as production. No wrapper translation layer.

Runs on_worker_startup / on_worker_shutdown so tests exercise the same code paths as production (Pounce). Without this, apps that use on_worker_startup for per-worker DB connections or httpx clients would fail at runtime (e.g. rag_demo _db_var, ollama _client_var).

testing.client

Name Type Default Description
type —
qualified_name —
element_type —
description —
source_file —
line_number —
is_autodoc —
autodoc_element —
_autodoc_template —
_autodoc_url_path —
_autodoc_page_type —
title —
doc_content_hash —

Symbols on this page

_worker_lifecycle_receive
function async
async def _worker_lifecycle_receive() -> dict[str, Any]

Dummy receive for worker startup/shutdown — returns disconnect immediately.

No parameters.

_worker_lifecycle_send
function async
async def _worker_lifecycle_send(message: MutableMapping[str, Any]) -> None

No-op send for worker startup/shutdown.

Parameters

Name Type Default Description
message MutableMapping[str, Any] —
TestClient
class

View source · /home/runner/work/chirp/chirp/site/../src/chirp/testing/client.py:1