Goal
The Python report renderers (schemalock/report.py: render_console, render_json, exit_code) are untested — there is no tests/test_report.py. Add tests mirroring the Rust-side report tests so both languages' output contracts are locked.
Scope
- Create tests/test_report.py.
- Cover
render_console with mixed Pass/Fail/Error CheckResults (assert per-check lines and the summary line).
- Cover
render_json: assert the written file is valid JSON with the exact config_name/summary/results shape, including error outcomes.
- Cover
exit_code for all-pass (0) vs any-non-pass (1).
- Follow existing test conventions (see tests/test_config.py and tests/test_checks.py for fixture style).
Why
Python's JSON report is diffed byte-for-byte against Rust in the CI parity gate (scripts/parity_check.py). Locking both sides' renderers prevents drift between the ports.
Success criteria
pytest passes with the new file under ruff check . and ruff format --check . clean.
- Every public function in schemalock/report.py is exercised at least once.
Goal
The Python report renderers (schemalock/report.py:
render_console,render_json,exit_code) are untested — there is no tests/test_report.py. Add tests mirroring the Rust-side report tests so both languages' output contracts are locked.Scope
render_consolewith mixed Pass/Fail/ErrorCheckResults (assert per-check lines and the summary line).render_json: assert the written file is valid JSON with the exactconfig_name/summary/resultsshape, including error outcomes.exit_codefor all-pass (0) vs any-non-pass (1).Why
Python's JSON report is diffed byte-for-byte against Rust in the CI parity gate (scripts/parity_check.py). Locking both sides' renderers prevents drift between the ports.
Success criteria
pytestpasses with the new file underruff check .andruff format --check .clean.