Skip to content

Unit tests for Python report renderers (report.py) #18

Description

@ToryMic

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    drips-waveStellar Wave Program — Drips issuegood first issueGood for newcomerstrivialWorth 100 Points (Base)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions