[MyPy][2/N] Fix mypy errors in small tests/ dirs (#51043)

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Martin Hickey
2026-09-29 21:27:45 +01:00
committed by GitHub
co-authored by Harry Mellor Claude Opus 5.5
parent a96ee5935d
commit 5dd693122c
71 changed files with 491 additions and 301 deletions
+5 -5
View File
@@ -85,12 +85,12 @@ def test_multiproc_executor_worker_termination_timeout(
monkeypatch.setattr(multiproc_executor_module.time, "sleep", clock.sleep)
executor = MultiprocExecutor.__new__(MultiprocExecutor)
proc = _FakeProcess(clock, exits_at=exits_at)
executor._ensure_worker_termination([proc])
executor._ensure_worker_termination([proc]) # type: ignore[list-item]
assert proc.terminate_called is expected_terminate
class CustomMultiprocExecutor(MultiprocExecutor):
def collective_rpc(
def collective_rpc( # type: ignore[override]
self,
method: str | Callable,
timeout: float | None = None,
@@ -98,7 +98,7 @@ class CustomMultiprocExecutor(MultiprocExecutor):
kwargs: dict | None = None,
non_block: bool = False,
unique_reply_rank: int | None = None,
kv_output_aggregator: KVOutputAggregator = None,
kv_output_aggregator: KVOutputAggregator | None = None,
ec_output_aggregator: ECOutputAggregator | None = None,
) -> Any | list[Any] | Future[Any | list[Any]]:
# Drop marker to show that this was run
@@ -126,7 +126,7 @@ def test_custom_executor_type_checking():
model=MODEL,
gpu_memory_utilization=0.2,
max_model_len=8192,
distributed_executor_backend=Mock,
distributed_executor_backend=Mock, # type: ignore[arg-type]
)
LLMEngine.from_engine_args(engine_args)
with pytest.raises(ValueError):
@@ -134,7 +134,7 @@ def test_custom_executor_type_checking():
model=MODEL,
gpu_memory_utilization=0.2,
max_model_len=8192,
distributed_executor_backend=Mock,
distributed_executor_backend=Mock, # type: ignore[arg-type]
)
AsyncLLM.from_engine_args(engine_args)