test: type-check the test suite with mypy strict - #52
Merged
Conversation
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
reviewed
Aug 10, 2026
sirosen
left a comment
Contributor
There was a problem hiding this comment.
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.
Co-authored-by: Stephen Rosen <sirosen@globus.org>
henryiii
commented
Aug 10, 2026
sirosen
approved these changes
Aug 10, 2026
henryiii
marked this pull request as ready for review
August 10, 2026 21:45
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.
🤖 AI text below 🤖
Adds type annotations to the test suite and includes
tests/in the strict mypy run.Beyond the annotations themselves:
mypy src/, which overrides the config'sfileslist — it now runs baremypyso the tests are checked in CI.pytestis added to thetypingdependency group; without it,ignore_missing_importsdegrades pytest types toAny.CliRunnerinconftest.pyis now callable directly (__call__instead of.invoke), so therunfixtures return the runner itself and no separate Protocol type is needed.CliRunnerasserts CLI exit codes are ints whereSystemExitis caught, keepingCLIResult.codeanint(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/