Writes pytest unit and integration tests for a use case's backend, against an ephemeral Postgres container, and updates the use-case-to-test traceability matrix. Use when the user asks to "write tests for UC-xxx", "add pytest coverage", "test the backend", or mentions unit tests, integration tests, or pytest for a specific use case.
80
100%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
Write pytest unit and integration tests for use case $ARGUMENTS, following docs/guidelines/testing.md. Cover the
main success scenario and every alternative/failure flow — a use case is not "tested" on the strength of its happy
path alone.
testcontainers-python) because SQLite's default case-insensitive LIKE would let a test pass while
violating a business rule that depends on Postgres's actual case-sensitive default (UC-004 BR-001), or vice versa
for the case-insensitive constraints (testing.md §4.2).TestClient/httpx calls directly — these tests physically cannot exercise it, and asserting it
here would be a false sense of coverage. That belongs to /playwright-test against a deployed API (testing.md
§4.4).moto or dependency injection if the use case under test touches one
(testing.md §4.3) — this use case set currently doesn't, but future ones might.docs/guidelines/testing.md §7 stale. Update this use case's row once its tests exist, so the traceability
matrix reflects reality rather than aspiration.docs/use-cases/UC-*.md — main flow, every alternative flow, and its business
rules (BR-xxx).docs/guidelines/testing.md §7 for which test layers (Unit / Integration / E2E) this use case is expected
to have, and which specific BR-xxx items need coverage.pytest with unittest.mock/
pytest-mock to isolate from the database.TestClient (backed by httpx) against the actual routers, backed by
the ephemeral Postgres container fixture — verify HTTP status codes and response bodies, not just "it didn't
crash."uv run pytest and confirm everything passes, then uv run mypy app/ and uv run ruff check app/ — all
three gate CI (testing.md §2, §6).docs/guidelines/testing.md §7 to reflect the coverage actually written.docs/guidelines/testing.md — fixture strategy, what belongs at each test layer, and the traceability matrix.docs/use-cases/UC-*.md — the flows and business rules to cover.../../rules/mcp-servers.md. It is not needed for the ephemeral test-container workflow itself.dee4c03
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.