Repository navigation
Commit 0dacf4f
committed
Fix mypy 2.3.0 type errors in the test suite
mypy 2.3.0 (released 2026-07-13) is stricter and surfaces 7 errors in the test
suite on unmodified main (CI's `mypy<3,>=2.1` floats to it), failing the Lint
job on every open PR. All test-only, no behavioural change.
- tests/utils/assert_equal_awaitables_or_values.py: the awaitable branch
returns a coroutine where the declared TypeVar `T` is expected; cast it (the
function returns an awaitable iff its inputs are awaitables).
- tests/execution/test_abstract.py: the conditionally-defined `is_type_of` and
`type_error` (sync vs async variants) now must have identical signatures;
pre-declare each with an explicit `Callable[..., Any]`.
- tests/execution/test_stream.py: `name` is assigned either a coroutine
(`throw()`) or a `str`; annotate it `Any`.
- tests/execution/test_middleware.py: the awaited `subscribe(...)` item is
inferred as `object`; cast it to `ExecutionResult` before reading `.data`.
mypy src tests, ruff check src tests and ruff format --check src tests are all
clean under the pinned tool versions (mypy 2.3.0, ruff 0.15.21).1 parent 56d4338 commit 0dacf4f
4 files changed
Lines changed: 18 additions & 5 deletions
File tree
- tests
- execution
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
| 57 | + | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
| |||
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| 74 | + | |
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
8 | 14 | | |
9 | 15 | | |
10 | 16 | | |
| |||
262 | 268 | | |
263 | 269 | | |
264 | 270 | | |
265 | | - | |
| 271 | + | |
266 | 272 | | |
267 | | - | |
| 273 | + | |
268 | 274 | | |
269 | 275 | | |
270 | 276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1691 | 1691 | | |
1692 | 1692 | | |
1693 | 1693 | | |
| 1694 | + | |
1694 | 1695 | | |
1695 | 1696 | | |
1696 | 1697 | | |
| |||
1757 | 1758 | | |
1758 | 1759 | | |
1759 | 1760 | | |
| 1761 | + | |
1760 | 1762 | | |
1761 | 1763 | | |
1762 | 1764 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
0 commit comments