Skip to content

Reject invalid coverage thresholds before running tests - #773

Open
moelomda wants to merge 1 commit into
pytest-dev:masterfrom
moelomda:codex/validate-cov-fail-under
Open

moelomda wants to merge 1 commit into
pytest-dev:masterfrom
moelomda:codex/validate-cov-fail-under

Conversation

@moelomda

@moelomda moelomda commented Nov 10, 2026 •

Copy link
Copy Markdown

Invalid --cov-fail-under values such as nan, -inf, and -1 currently run the tests and then raise an internal error in coverage.py. Reject them during argument parsing with a usage error before test collection. Preserve valid thresholds from 0 through 100 and the existing error for values above 100.

Add CLI regressions that check invalid values cannot trigger collection, cover valid boundaries, and document the accepted range.

Validation: seven regression cases fail on the unchanged base. The updated applicable suite passes with 228 passed, 3 Windows-only skips, and the Docker/Redis/Celery integration case excluded because its prerequisites are unavailable. tox check and the documentation HTML build pass. Documentation linkcheck was stopped after GitHub rate limits; it also reported an existing broken changelog link. The full Python matrix was not run locally.

Prepared and verified with Codex assistance.

Hosted CI is awaiting maintainer approval (Tests run); no hosted test results are available yet.

@moelomda
moelomda marked this pull request as ready for review November 10, 2026 18:15
Copilot AI balanced review requested due to automatic review settings November 10, 2026 18:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants