diff --git a/src/coverage_gate.py b/src/coverage_gate.py index d13c9f8..664fb68 100644 --- a/src/coverage_gate.py +++ b/src/coverage_gate.py @@ -53,6 +53,7 @@ import json import logging import os import subprocess +import sys from .config import settings from .git_worktree import ensure_worktree, get_worktree_path @@ -140,8 +141,11 @@ def measure_coverage(repo: str, branch: str) -> float | None: except OSError: pass + # Use the SAME interpreter that runs the orchestrator (sys.executable), not a + # bare "python" — the prod container / CI runner expose "python3", and the + # pytest-cov plugin lives in exactly this interpreter's environment. cmd = [ - "python", "-m", "pytest", "tests/", + sys.executable, "-m", "pytest", "tests/", "--cov=src", f"--cov-report=json:{cov_json}", "--cov-report=", # suppress the terminal cov report (json only)