The Python workspace already runs pytest-cov in CI but with no threshold and inline-flagged config. CI run 24956647701 (2026-04-26 staging) reports 97% coverage on the package — well above the issue's 75% target. The actionable gap is locking in a floor so a regression can't sneak past, and centralizing config so local `pytest` matches CI. Changes: - workspace/pytest.ini — coverage flags moved into addopts (-q, --cov=., --cov-report=term-missing, --cov-fail-under=92). 92% = current 97% measurement minus the 5pp safety margin the issue's Step 3 prescribes. - workspace/.coveragerc (new) — [run] omit list and [report] skip_covered. coverage.py doesn't read pytest.ini sections, so the omit config has to live here. - .github/workflows/ci.yml — removed the inline --cov flags from the Python Lint & Test step; now reads from pytest.ini. Workflow stays the same single-command shape, just simpler. Result: any PR that drops coverage below 92% fails CI loudly. Floor ratchets up by replacing 92 with current measurement on a future test-writing pass — same shape as Go coverage gates landed elsewhere. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
20 lines
796 B
INI
20 lines
796 B
INI
[pytest]
|
|
testpaths = tests
|
|
python_files = test_*.py
|
|
python_functions = test_*
|
|
asyncio_mode = auto
|
|
# Coverage config moved here from .github/workflows/ci.yml so local
|
|
# `pytest` matches CI without operator-typed flags. cov-fail-under
|
|
# pins the floor at 92% — 5pp below the 97% measured on staging
|
|
# (run 24956647701, 2026-04-26). Floor exists so a regression that
|
|
# drops coverage doesn't sneak past CI; tightening above 92% should
|
|
# follow real measurement, not aspiration. See issue #1817.
|
|
addopts =
|
|
-q
|
|
--cov=.
|
|
--cov-report=term-missing
|
|
--cov-fail-under=92
|
|
# Coverage omit / report config lives in workspace/.coveragerc — coverage.py
|
|
# only reads .coveragerc / setup.cfg / tox.ini / pyproject.toml, NOT
|
|
# pytest.ini, so [coverage:*] sections here would be silently ignored.
|