Skip to content

Sprint 29 T1: CLI test coverage hardening — in-process refactor#146

Merged
dp-web4 merged 1 commit into
mainfrom
worker/web4-20260410-060000
Apr 10, 2026
Merged

Sprint 29 T1: CLI test coverage hardening — in-process refactor#146
dp-web4 merged 1 commit into
mainfrom
worker/web4-20260410-060000

Conversation

@dp-web4
Copy link
Copy Markdown
Owner

@dp-web4 dp-web4 commented Apr 10, 2026

Summary

  • Refactored CLI tests (test_cli.py) from subprocess-only to in-process main(argv) + capsys calls
  • Added TestGenerate class (5 tests) for previously untested generate subcommand CLI paths
  • Kept TestSmoke class (3 subprocess tests) for end-to-end entry point validation
  • __main__.py coverage: 15.8% → 90.6%, overall: 96.2% → 97.8%
  • 2608 tests passing (up from 2600), mypy strict clean, 0 new files

Test plan

  • All 40 CLI tests pass (pytest tests/test_cli.py -v)
  • Full suite passes: 2608 tests, 1 warning
  • __main__.py coverage ≥90% verified via --cov=web4.__main__
  • mypy --strict clean (25 files)
  • No new files created

🤖 Generated with Claude Code

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>
@dp-web4
Copy link
Copy Markdown
Owner Author

dp-web4 commented Apr 10, 2026

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.

@dp-web4 dp-web4 merged commit 37cddbc into main Apr 10, 2026
4 of 5 checks passed
@dp-web4 dp-web4 deleted the worker/web4-20260410-060000 branch April 10, 2026 17:06
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.

1 participant