3.0 KiB
3.0 KiB
name, description, argument-hint, agent
| name | description | argument-hint | agent |
|---|---|---|---|
| Pytest Fill Scaffold | Fill scaffolded pytest test methods with assertions, fixtures, and minimal test data while preserving concise test names and one-line intent docstrings. | Target test file(s) under tests plus stack (pure-python, fastapi, sqlalchemy-sync, sqlalchemy-async, or mixed) | agent |
Pytest Fill Scaffold
Use this prompt after test scaffolding exists and method names/docstrings are already in place.
Inputs
- Target test file(s) under
tests/. - Stack type:
pure-pythonfastapisqlalchemy-syncsqlalchemy-asyncmixed
- Optional constraints:
- keep implementation minimal vs comprehensive
- marker lane target (
unit,integration,smoke)
Required References
Load these in order and use only what matches the task:
- Core defaults: pytest scaffolding skill
- Naming/hierarchy preservation: naming and organization
- Baseline pytest fixtures/markers: pytest docs notes
- FastAPI-specific behavior (only when needed): fastapi testing
- SQLAlchemy-specific behavior (only when needed): sqlalchemy testing
Workflow
- Inspect target files and treat human-reviewed docstring-only scaffolds as invariant.
- Convert each scaffolded method into an executable test with a single behavior focus.
- Keep one-line docstrings for class and method intent.
- Add or refine fixtures at the nearest useful scope:
- global in
tests/conftest.pyonly when broadly reusable - subtree
conftest.pyfor domain-specific fixtures
- global in
- Assign markers consistent with cost and dependencies:
unitfor pure logicintegrationfor framework/DB contractssmokefor thin critical-path checks
- Validate in this order:
uv run pytest --collect-only -quv run pytest -m unit -qwhen unit tests are toucheduv run pytest -qif dependencies are available
Authoring Rules
- Prefer deterministic tests and explicit setup/teardown.
- Keep assertions precise and readable.
- Do not overfit tests to private implementation details.
- If a scaffolded class or method has only a docstring body, treat its name and hierarchy as locked.
- Do not rename, move, merge, split, or re-nest docstring-only scaffolded tests unless explicitly requested.
- Preserve existing one-line docstrings on scaffolded classes and methods unless they are factually incorrect.
- If stack details are missing and would change fixture strategy, ask one concise clarifying question before editing.
Output Format
Return:
- Files updated.
- Fixture and marker decisions.
- Which references were used and why.
- Validation command results.
- Risks or open questions.