-
Notifications
You must be signed in to change notification settings - Fork 0
Add type annotations to all test files and enforce strict mypy #87
Copy link
Copy link
Closed
Labels
prio:highImportant, should be prioritizedImportant, should be prioritizedprio:mediumShould do, but not blockingShould do, but not blockingscope:medium1-3 days of work1-3 days of workspec:architectureDESIGN_SPEC Section 15 - Technical ArchitectureDESIGN_SPEC Section 15 - Technical Architecturespec:providersDESIGN_SPEC Section 9 - Model Provider LayerDESIGN_SPEC Section 9 - Model Provider Layertype:infraCI/CD, tooling, project setupCI/CD, tooling, project setuptype:refactorCode restructuring, cleanupCode restructuring, cleanup
Milestone
Metadata
Metadata
Assignees
Labels
prio:highImportant, should be prioritizedImportant, should be prioritizedprio:mediumShould do, but not blockingShould do, but not blockingscope:medium1-3 days of work1-3 days of workspec:architectureDESIGN_SPEC Section 15 - Technical ArchitectureDESIGN_SPEC Section 15 - Technical Architecturespec:providersDESIGN_SPEC Section 9 - Model Provider LayerDESIGN_SPEC Section 9 - Model Provider Layertype:infraCI/CD, tooling, project setupCI/CD, tooling, project setuptype:refactorCode restructuring, cleanupCode restructuring, cleanup
Summary
Add return type annotations and full type hints to all test files, then remove the
disallow_untyped_defs = falsemypy override fortests.*so strict typing is enforced going forward.Motivation
The
pyproject.tomlcurrently relaxes mypy for tests:This lets untyped test functions accumulate silently. As of now there are 219 mypy errors across 24 test files — a manageable amount. If we wait, this number will grow with every new test file, making the eventual cleanup much more painful.
Scope
-> Nonereturn annotations to all test functions and fixturestype-arg,arg-type,attr-defined,no-untyped-callerrors that surfacedisallow_untyped_defs = falseoverride frompyproject.tomluv run mypy src/ tests/passes with zero errorsCurrent error breakdown
Common error categories:
no-untyped-def: missing-> Noneon test functionstype-arg: missing generic type parameters (list→list[Any])attr-defined: accessing attributes onBaseExceptioninstead of typed error classesarg-type: dict invariance issues (dict[str, SubClass]vsdict[str, BaseClass])Acceptance criteria
uv run mypy src/ tests/passes with zero errorsdisallow_untyped_defs = falseoverride removed frompyproject.toml