advanced-alchemy
Auto-activate for advanced_alchemy imports, alembic/, SQLAlchemyAsyncRepositoryService, SQLAlchemyAsyncConfig, repository_type, service_class, filters, or…
Auto-activate for pytest_databases, Docker DB fixtures, PostgreSQL/pgvector/ParadeDB, MySQL/MariaDB, Oracle/SQL Server, CockroachDB/YugabyteDB, MongoDB, Redis/Valkey, Elasticsearch, BigQuery/Spanner, Azurite, MinIO, or RustFS tests. Not for mocked databases.
$ npx -y skills add litestar-org/litestar-skills --skill pytest-databases --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/pytest-databasesContext preview
The summary Claude sees to decide when to auto-load this skill.
Auto-activate for pytest_databases, Docker DB fixtures, PostgreSQL/pgvector/ParadeDB, MySQL/MariaDB, Oracle/SQL Server, CockroachDB/YugabyteDB, MongoDB, Redis/Valkey, Elasticsearch, BigQuery/Spanner, Azurite, MinIO, or RustFS tests. Not for mocked databases.
name: pytest-databases description: "Auto-activate for pytest_databases, Docker DB fixtures, PostgreSQL/pgvector/ParadeDB, MySQL/MariaDB, Oracle/SQL Server, CockroachDB/YugabyteDB, MongoDB, Redis/Valkey, Elasticsearch, BigQuery/Spanner, Azurite, MinIO, or RustFS tests. Not for mocked databases."
`pytest-databases` provides session-scoped, container-backed service fixtures. This guidance targets the immutable `v0.19.0` tag. Load only the plugin modules the test suite uses. Consume a ready client fixture where one exists; otherwise connect with the client already used by the project.
PostgreSQL connection fixtures use synchronous `psycopg`; do not `await` their methods.
the project's existing client from the service object's host, port, and credentials.
backend globally.
pip install "pytest-databases[postgres]"
# conftest.py pytest_plugins = ["pytest_databases.docker.postgres"]
The core `pytest_databases` pytest entry point supplies `docker_client` and `docker_service`. Each database module supplies its own fixtures.
| Need | Use | | --- | --- | | A ready `psycopg` connection | `postgres_connection`, a versioned PostgreSQL-family connection, or `cockroachdb_connection` | | A ready vendor client | `bigquery_client`, `spanner_connection`, `mongodb_connection`, an Oracle connection, a GizmoSQL connection, or an Azure Blob container client | | Service coordinates for the project's own client | The backend's `*_service` fixture | | A specific PostgreSQL-family release | Matching `*_NN_service`, `*_NN_connection`, and `*_NN_port` fixtures | | Parallel worker isolation | The backend's exact `*_xdist_isolation_level` fixture from [xdist.md](references/xdist.md) |
See [reference.md](references/reference.md) for the exact plugin, service, and ready-client matrix. Do not infer a `*_connection` fixture from a `*_service` fixture's name.
<workflow>
1. Install the extra matching the selected backend. Backends with no bundled Python client, such as MySQL, MariaDB, SQL Server, and YugabyteDB, expose service fixtures and expect the project to supply its own driver. 2. Add only the required `pytest_databases.docker.<module>` entries to `pytest_plugins`. 3. Prefer a ready client fixture listed in [reference.md](references/reference.md). Otherwise construct the project's existing client from the typed service fixture. 4. Override session-scoped configuration fixtures in `conftest.py`. Use environment variables only where 0.19.0 explicitly reads them; see [config.md](references/config.md). 5. For `pytest-xdist`, keep the default `"database"` isolation when the service supports logical namespaces. Override the backend's exact isolation fixture to `"server"` when each worker needs its own container. 6. Run the focused integration tests against a Docker-compatible daemon.
</workflow>
<guardrails>
(`*_connection`, `*_client`) exist for PostgreSQL-family, CockroachDB, Oracle, GizmoSQL, BigQuery, Spanner, MongoDB, and Azure Blob. Service-only backends (MySQL, MariaDB, SQL Server, YugabyteDB, Dolt, Redis, Dragonfly, KeyDB, Valkey, Elasticsearch, MinIO, and RustFS) export service fixtures but no ready client. Build the project's client from the service object's coordinates; convenience `*_host`/`*_port` fixtures are backend-specific.
`pytest_databases.docker.azure_blob`, the service is `AzureBlobService`, and the ready clients are `azure_blob_container_client` and `azure_blob_async_container_client`.
`psycopg.Connection`; call `execute()` directly.
uses `azure_blob_xdist_isolation_level`; most others use `xdist_<backend>_isolation_level`.
lifecycle through `docker_service`.
Use the 0.19.0 `*_port` fixture or matching PostgreSQL-family environment variable only when a rootless/container-network constraint requires it.
</guardrails>
<validation>
[reference.md](references/reference.md).
fabricated `*_connection` fixture.
[config.md](references/config.md).
</validation>
<example>
import psycopg
pytest_plugins = ["pytest_databases.docker.postgres"]
def test_postgres_is_ready(
postgres_connection: psycopg.Connection,
) -> None:
row = postgres_connection.execute("SELECT 1").fetchone()
assert row == (1,)`postgres_connection` is a synchronous `psycopg.Connection`. Use an async driver only by constructing it separately from `postgres_service`.
</example>
---
Opinionated, first-party agent skills, plugins, subagents, slash commands, and MCP servers for the Litestar framework and its ecosystem — publishable to every major AI agent and IDE from a single repo.
Repo: litestar-org/litestar-skills
Auto-activate for advanced_alchemy imports, alembic/, SQLAlchemyAsyncRepositoryService, SQLAlchemyAsyncConfig, repository_type, service_class, filters, or…
Auto-activate for Google ADK, LlmAgent, Runner, SQLSpecSessionService, Vertex AI, SSE agent chats, tool calls, or Litestar model workflows. Not for offline ML…
Auto-activate for guards=, Guard, ASGIConnection, JWTAuth, JWTCookieAuth, SessionAuth, role or tenant checks, or WebSocket auth. Not for frontend route…
Auto-activate for litestar_autowire, AutowirePlugin, AutowireConfig, domain_packages, AutowireIntegration, AutowireLoader, or clear_autowire_cache. Not for…
Auto-activate for uv build, hatch build, PyApp, PYAPP_*, wheel assets, GitHub release matrices, cargo-zigbuild, or python-build-standalone. Not for runtime…
Auto-activate for SQLAlchemyAsyncRepositoryService, SQLSpecAsyncService, create_filter_dependencies, LimitOffsetFilter, OffsetPagination, filters, or CRUD…