Skip to content

test: type-check the test suite with mypy strict - #52

Merged
henryiii merged 3 commits into
mainfrom
typed-tests
Aug 10, 2026
Merged

test: type-check the test suite with mypy strict#52
henryiii merged 3 commits into
mainfrom
typed-tests

Conversation

@henryiii

@henryiii henryiii commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

Adds type annotations to the test suite and includes tests/ in the strict mypy run.

Beyond the annotations themselves:

  • The tox mypy env ran mypy src/, which overrides the config's files list — it now runs bare mypy so the tests are checked in CI.
  • pytest is added to the typing dependency group; without it, ignore_missing_imports degrades pytest types to Any.
  • The shared CliRunner in conftest.py is now callable directly (__call__ instead of .invoke), so the run fixtures return the runner itself and no separate Protocol type is needed.
  • CliRunner asserts CLI exit codes are ints where SystemExit is caught, keeping CLIResult.code an int (all three CLIs only exit with ints).

Verified with mypy on 3.9 and 3.14, pytest, and pre-commit.


📚 Documentation preview 📚: https://dependency-groups--52.org.readthedocs.build/en/52/

Add annotations to all tests and run mypy on tests in CI. The tox mypy
env now uses the config file list, and the typing group gets pytest so
the checks see real pytest types.

Assisted-by: ClaudeCode:claude-fable-5

@sirosen sirosen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The switch to make CliRunner callable is the sort of thing I had in mind that could get "messy". It wasn't as bad as I worried it might be!

I'm pretty much ready to approve if you think it's ready -- I had only one small note.

Comment thread tests/conftest.py Outdated
Co-authored-by: Stephen Rosen <sirosen@globus.org>
Comment thread tests/conftest.py Outdated
@henryiii
henryiii marked this pull request as ready for review August 10, 2026 21:45
@henryiii
henryiii merged commit 2a7bd08 into main Aug 10, 2026
10 checks passed
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