Unit-Tests Hook Implementation Summary | Generated by AI

Home 2026.06

All good. The unit-tests hook works. Here’s the summary:

WHAT WAS ADDED:

  1. .pre-commit-config.yaml — new unit-tests local hook at the end
    • Runs: uv run python -m pytest tests/ -x -q --tb=short
    • -x = stop on first failure (fast feedback)
    • -q = quiet output
    • --tb=short = short tracebacks
    • always_run: true = runs on every commit regardless of which files changed
  2. pyproject.toml — added [dependency-groups] with pytest and coverage as dev deps
    • uv sync now installs them automatically

PERFORMANCE: 1707 passed, 153 skipped in ~8 seconds. Acceptable for every commit.

NOTE: The other pre-existing hook failures (ruff E741, pyright missing imports, bandit arg error) are unrelated — they existed before this change. The unit-tests hook itself passes cleanly.

If 8s feels too slow over time, you can add stages: [pre-push] to move it to pre-push only, or add --ignore=tests/slow_test.py to skip specific slow files.


Back Donate