Files
Octop/conftest.py
jubaoliangandClaude cdbeae28d0 fix(precommit): detect staged changes so testmon gate isn't a false green
testmon decides which files changed via `git ls-files --stage -m` (worktree
vs index). At pre-commit time the changes are already staged, so that
comparison is empty and testmon silently deselects every test — a false
green that makes the fast gate worthless.

Patch testmon's file detection to use `git diff HEAD` (staged + unstaged)
via conftest.py and tests/support/testmon_staged_changes.py, so the gate
actually fires on a commit's changes. No-op when testmon is absent.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-12 06:23:25 +00:00

12 lines
438 B
Python

"""Repo-root conftest.
Imported by pytest at startup (before any plugin's ``pytest_configure``), so the
testmon change-detection patch in ``tests.support.testmon_staged_changes`` is
applied before testmon reads file fingerprints. The patch only affects
testmon's internals and is a safe no-op when testmon is absent.
"""
from __future__ import annotations
import tests.support.testmon_staged_changes # noqa: F401 (applies the patch)