Skip to content

Clear mypy annotation-unchecked notes in tests#41

Merged
alexkroman merged 1 commit into
mainfrom
fix-mypy-annotation-unchecked-notes
Jun 8, 2026
Merged

Clear mypy annotation-unchecked notes in tests#41
alexkroman merged 1 commit into
mainfrom
fix-mypy-annotation-unchecked-notes

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

Summary

mypy emitted 18 annotation-unchecked notes across 9 test files. These fire when an untyped function body contains a variable annotation — mypy skips the body of an untyped function by default and notes that you'd need --check-untyped-defs to check it.

The fix adds -> None return annotations to the 14 enclosing test functions, which makes mypy treat them as typed and check their bodies. This matches the project convention that tests are exempt from requiring return annotations but are still type-checked.

Verification

  • uv run mypySuccess: no issues found in 142 source files (all notes gone)
  • uv run pyright -p pyrightconfig.tests.json0 errors, 0 warnings

🤖 Generated with Claude Code

These 14 test functions carried variable annotations in otherwise-untyped
bodies, so mypy skipped their bodies and emitted annotation-unchecked notes.
Adding `-> None` return annotations makes mypy type-check the bodies, clearing
the notes. Tests stay exempt from requiring return annotations elsewhere; this
only annotates the functions that already had body-level annotations.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alexkroman alexkroman merged commit be1eff6 into main Jun 8, 2026
10 checks passed
@alexkroman alexkroman deleted the fix-mypy-annotation-unchecked-notes branch June 8, 2026 14:52
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