Testing Skill
Purpose
Guarantee correctness and regression safety across all test scopes.
Test Topology
tests/unit: default fast scope.tests/integration: component and backend interactions.tests/end2end: full pipeline and CLI journeys.- Preferred target: mirror
src/extractformsstructure undertests/unitfor new or moved tests.- example:
src/extractforms/foo/bar.py->tests/unit/foo/test_bar.py - current flat tests are acceptable during migration; avoid mixing conventions in the same feature area.
- example:
Markers are auto-assigned by directory in tests/conftest.py.
Workflow
- Write or update unit tests first.
- Add integration tests for boundaries and adapters.
- Add end2end tests for user-visible workflows.
- Run unit tests during iteration.
- Run integration and end2end suites before PR completion.
Commands
uv run pytest -m unituv run pytest -m integrationuv run pytest -m end2end
Quality Rules
- Make tests deterministic with explicit seeds and stable fixtures.
- Keep unit tests free of hidden external dependencies.
- Add offline/network-dependent scenarios when relevant.
- Add representative fixtures for each supported document type.
- When adding or moving unit tests, prefer the mirrored structure; migrate flat tests progressively when touching them.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.