Sprint 29 T1: CLI test coverage hardening — in-process refactor#146
Merged
Conversation
CLI module (__main__.py) was at 15.8% measured coverage despite having comprehensive tests — all used subprocess.run() in child processes invisible to coverage. Converted to in-process main(argv) + capsys calls. Added TestGenerate class (5 tests) and TestSmoke subprocess class (3 tests). Result: __main__.py coverage 15.8% → 90.6%, overall 96.2% → 97.8%. 2608 tests passing (up from 2600). mypy strict clean. 0 new files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
Author
|
APPROVED: Sprint 29 T1 — CLI test coverage hardening. 0 new files. Refactors test_cli.py from subprocess-only to in-process main(argv) + capsys, bringing main.py coverage from 15.8% to 90.6%. Adds TestGenerate class (5 tests) for previously untested generate subcommand. Keeps TestSmoke class (3 subprocess tests) for end-to-end entry point validation. 2608 total tests (up from 2600). mypy strict clean. Well-scoped, no drift. |
This was referenced Jun 3, 2026
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
test_cli.py) from subprocess-only to in-processmain(argv)+capsyscallsTestGenerateclass (5 tests) for previously untested generate subcommand CLI pathsTestSmokeclass (3 subprocess tests) for end-to-end entry point validation__main__.pycoverage: 15.8% → 90.6%, overall: 96.2% → 97.8%Test plan
pytest tests/test_cli.py -v)__main__.pycoverage ≥90% verified via--cov=web4.__main__mypy --strictclean (25 files)🤖 Generated with Claude Code