test: exclude generated grpc stubs from coverage, add fail-under gate, cover scope branch#8
Merged
Merged
Conversation
…der gate, cover scope branch - pyproject.toml: [tool.coverage.run] omit grpc/gen (already excluded from ruff/mypy); [tool.coverage.report] fail_under=96 regression gate. Coverage 97.97% with generated stubs excluded. - test_grpc_client: cover the check_access scope-on-wire branch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015W5NRYP2gev6xQ2JURfYZU
- Shorten the test method name to satisfy ruff E501 (line-length). - Annotate the servicer's last_request as Optional and None-guard the scope assertion. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015W5NRYP2gev6xQ2JURfYZU
…26-3447) Python 3.10/3.11 runners ship setuptools 79.0.1, which pip-audit flags (PYSEC-2026-3447, fixed in 83.0.0), failing the Test job on those versions (3.12/3.13 already ship a patched setuptools). Upgrade pip + setuptools before the audit so the scan reflects a patched environment — resolves the finding rather than suppressing it. Verified pip-audit reports no vulnerabilities. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015W5NRYP2gev6xQ2JURfYZU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Coverage was already ~96% with generated protobuf stubs counted. This aligns the coverage scope with the repo's existing exclusions and adds a regression gate.
Changes
pyproject.toml:[tool.coverage.run] omit = ["*/grpc/gen/*"]—grpc/genis protoc output, already excluded from ruff (extend-exclude) and mypy (exclude); measuring generated stubs diluted the ratio.[tool.coverage.report] fail_under = 96regression gate (respected bypytest --cov).tests/test_grpc_client.py: covers thecheck_accessscope-on-wire branch (and records the request on the test servicer).221 tests pass; coverage 97.97% with generated stubs excluded.
🤖 Generated with Claude Code
https://claude.ai/code/session_015W5NRYP2gev6xQ2JURfYZU
Generated by Claude Code