Commit 07e8d85
committed
Fix CI: Callable import + ControlTaskLike Protocol
Two failures introduced by the previous polish commits caught by CI:
- ruff UP035 on lib/galaxy_test/base/sse.py: Callable must be imported
from collections.abc, not typing (newer ruff version than the local
venv had).
- packages mypy on test_sse_dispatch_cache.py:78: the injected
control_task_factory's type was Callable[[GalaxyQueueWorker],
ControlTask], which rejected NoopControlTask (and would have also
rejected FakeControlTask / BoomControlTask) because none of the test
classes subclass ControlTask.
Introduce a ControlTaskLike Protocol covering the single method the
dispatcher calls (``send_task(**kwargs)``) and type the factory against
it. Keeps ControlTask itself as the production default and lets the
test fakes pass via structural typing.1 parent b3dfeba commit 07e8d85
2 files changed
Lines changed: 15 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
32 | 44 | | |
33 | 45 | | |
34 | 46 | | |
| |||
56 | 68 | | |
57 | 69 | | |
58 | 70 | | |
59 | | - | |
| 71 | + | |
60 | 72 | | |
61 | 73 | | |
62 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 12 | + | |
| 13 | + | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
| |||
0 commit comments