tightening
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
---
|
||||
name: fill-pytest-scaffold
|
||||
description: Fill scaffolded pytest test methods with assertions, fixtures, and minimal test data while preserving concise test names and one-line intent docstrings.
|
||||
x-personal-mcp:
|
||||
id: fill-pytest-scaffold
|
||||
version: 1.0.0
|
||||
tags:
|
||||
- pytest
|
||||
- testing
|
||||
- scaffolding
|
||||
- prompts
|
||||
capabilities:
|
||||
- resource://prompts/fill-pytest-scaffold/document
|
||||
arguments:
|
||||
target_files:
|
||||
description: Target test file paths under tests/.
|
||||
required: true
|
||||
stack:
|
||||
description: Runtime stack type for fixture and marker choices.
|
||||
required: true
|
||||
strategy:
|
||||
description: Balance between minimal and comprehensive implementation.
|
||||
required: false
|
||||
marker_lane:
|
||||
description: Preferred marker lane when applicable.
|
||||
required: false
|
||||
---
|
||||
|
||||
# Fill Pytest 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-python
|
||||
- fastapi
|
||||
- sqlalchemy-sync
|
||||
- sqlalchemy-async
|
||||
- mixed
|
||||
- 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:
|
||||
|
||||
1. Core defaults: [pytest scaffolding skill](../../skills/pytest-scaffolding/SKILL.md)
|
||||
2. Naming/hierarchy preservation: [naming and organization](../../skills/pytest-scaffolding/references/naming-and-organization.md)
|
||||
3. Baseline pytest fixtures/markers: [pytest docs notes](../../skills/pytest-scaffolding/references/pytest-docs.md)
|
||||
4. FastAPI-specific behavior (only when needed): [fastapi testing](../../skills/pytest-scaffolding/references/fastapi-testing.md)
|
||||
5. SQLAlchemy-specific behavior (only when needed): [sqlalchemy testing](../../skills/pytest-scaffolding/references/sqlalchemy-testing.md)
|
||||
|
||||
## Workflow
|
||||
|
||||
1. Inspect target files and treat human-reviewed docstring-only scaffolds as invariant.
|
||||
2. Convert each scaffolded method into an executable test with a single behavior focus.
|
||||
3. Keep one-line docstrings for class and method intent.
|
||||
4. Add or refine fixtures at the nearest useful scope:
|
||||
- global in tests/conftest.py only when broadly reusable
|
||||
- subtree conftest.py for domain-specific fixtures
|
||||
5. Assign markers consistent with cost and dependencies:
|
||||
- unit for pure logic
|
||||
- integration for framework/DB contracts
|
||||
- smoke for thin critical-path checks
|
||||
6. Validate in this order:
|
||||
- uv run pytest --collect-only -q
|
||||
- uv run pytest -m unit -q when unit tests are touched
|
||||
- uv run pytest -q if 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:
|
||||
1. Files updated.
|
||||
2. Fixture and marker decisions.
|
||||
3. Which references were used and why.
|
||||
4. Validation command results.
|
||||
5. Risks or open questions.
|
||||
@@ -1,23 +0,0 @@
|
||||
---
|
||||
name: initial-test-structure
|
||||
description: Create an initial pytest test structure for a target project scope using repository conventions.
|
||||
x-personal-mcp:
|
||||
id: initial-test-structure
|
||||
version: 1.0.0
|
||||
tags:
|
||||
- pytest
|
||||
- testing
|
||||
capabilities:
|
||||
- resource://prompts/initial-test-structure/document
|
||||
arguments:
|
||||
target_scope:
|
||||
type: string
|
||||
description: Target project, package, or module to scaffold tests for.
|
||||
required: false
|
||||
---
|
||||
|
||||
# Prompt For Creating Initial Test Structure
|
||||
|
||||
Create an initial test structure in `./tests` based around pytest best practices.
|
||||
|
||||
Use for an overview of best practices `resource://skills/pytest-scaffolding/document`. Take into account the naming structure too and pull in other relevant resources like for fastapi testing
|
||||
Reference in New Issue
Block a user