Skip to content

test: import Result from typer.testing instead of click#206

Merged
bvanelli merged 1 commit into
mainfrom
claude/zen-carson-IuuqU
May 28, 2026
Merged

test: import Result from typer.testing instead of click#206
bvanelli merged 1 commit into
mainfrom
claude/zen-carson-IuuqU

Conversation

@bvanelli

Copy link
Copy Markdown
Owner

Summary

tests/test_cli.py imported Result from click.testing purely as a return-type annotation for the local invoke() helper. The project never declared click as a direct dependency — it was only present transitively because typer (pulled in via the cli extra) used to depend on it. Recent typer releases dropped the click dependency, so fresh CI installs no longer get click, and the import fails at test collection time, breaking the pipeline.

Switching to from typer.testing import Result fixes this without adding a new dependency. typer.testing re-exposes Result across the entire typer>=0.12.0 range declared in pyproject.toml:

  • typer 0.12.0 → click.testing.Result (when click was still a transitive dep)
  • typer 0.26.x → typer._click.testing.Result (typer now vendors click internally)

Verified empirically in both environments.

Test plan

  • CI pipeline (test.yaml) passes on this branch
  • tests/test_cli.py imports resolve without click installed

Generated by Claude Code

Newer typer releases no longer depend on click, so the transitive
click install is no longer guaranteed and `from click.testing import
Result` fails in CI. typer.testing re-exposes Result (backed by
click.testing.Result on older typer, and typer._click.testing.Result
on newer typer), so the import works across all supported typer
versions without needing a direct click dependency.
@codecov

codecov Bot commented May 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.62%. Comparing base (8bf97c6) to head (ccca87f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #206   +/-   ##
=======================================
  Coverage   97.62%   97.62%           
=======================================
  Files          21       21           
  Lines        3238     3238           
=======================================
  Hits         3161     3161           
  Misses         77       77           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bvanelli bvanelli merged commit ca2a6ee into main May 28, 2026
9 checks passed
@bvanelli bvanelli deleted the claude/zen-carson-IuuqU branch May 28, 2026 06:25
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