Background
Raised from PR #33 (#33).
Problem
tests/test_template.py currently exceeds 400 logical lines. The grouped assertion helper functions are defined inline in the top-level test file alongside test orchestration, making the file harder to navigate and maintain.
Task
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate.
Specifically:
- Create a new module
tests/test_support/contracts.py (with an appropriate tests/test_support/__init__.py if needed).
- Move the following helper functions—preserving their signatures and docstrings—into that new module:
assert_package_contracts
assert_makefile_contracts
assert_local_toolchain_contracts
assert_ci_contracts
assert_generated_documentation_contracts
assert_release_workflow_contracts
- Update
tests/test_template.py to import those functions from tests.test_support.contracts and remove their definitions from this file.
- Ensure all call sites (e.g. inside
test_generated_tooling_contracts and elsewhere) remain unchanged.
- Confirm the top-level test file falls below 400 logical lines after the refactor.
- Validate: run
make test and confirm all tests pass.
Acceptance criteria
tests/test_support/contracts.py exists and contains the six helper functions with their original signatures and docstrings.
tests/test_template.py imports the helpers from the new module and is below 400 logical lines.
- All existing test calls to the helpers are unmodified.
make test passes with no regressions.
Requested by @leynos.
Background
Raised from PR #33 (#33).
Problem
tests/test_template.pycurrently exceeds 400 logical lines. The grouped assertion helper functions are defined inline in the top-level test file alongside test orchestration, making the file harder to navigate and maintain.Task
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate.
Specifically:
tests/test_support/contracts.py(with an appropriatetests/test_support/__init__.pyif needed).assert_package_contractsassert_makefile_contractsassert_local_toolchain_contractsassert_ci_contractsassert_generated_documentation_contractsassert_release_workflow_contractstests/test_template.pyto import those functions fromtests.test_support.contractsand remove their definitions from this file.test_generated_tooling_contractsand elsewhere) remain unchanged.make testand confirm all tests pass.Acceptance criteria
tests/test_support/contracts.pyexists and contains the six helper functions with their original signatures and docstrings.tests/test_template.pyimports the helpers from the new module and is below 400 logical lines.make testpasses with no regressions.Requested by @leynos.