Disable mypy arg-type and assignment checks in tests (#59428)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Harry Mellor
2026-09-30 15:18:50 +00:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 17e9295dd5
commit fc2c801ad9
131 changed files with 402 additions and 409 deletions
+5 -5
View File
@@ -135,7 +135,7 @@ def test_attention_checks_preserve_global_and_target_scoped_support():
_TargetBackend,
["target"],
spec,
0, # type: ignore[arg-type]
0,
)
target_group.metadata_builders = [
_FakeMetadataBuilder(AttentionCGSupport.ALWAYS) # type: ignore[list-item]
@@ -144,7 +144,7 @@ def test_attention_checks_preserve_global_and_target_scoped_support():
_DraftBackend,
["draft"],
spec,
0, # type: ignore[arg-type]
0,
)
draft_group.metadata_builders = [
_FakeMetadataBuilder(AttentionCGSupport.UNIFORM_BATCH) # type: ignore[list-item]
@@ -152,14 +152,14 @@ def test_attention_checks_preserve_global_and_target_scoped_support():
groups = [[target_group, draft_group]]
# The runner-wide execution mode must still honor the drafter's limit.
unfiltered = get_attn_cg_support(groups, None) # type: ignore[arg-type]
unfiltered = get_attn_cg_support(groups, None)
assert unfiltered.min_cg_support == AttentionCGSupport.UNIFORM_BATCH
assert unfiltered.min_cg_attn_backend == "_DraftBackend"
# Adaptive verification validates only the target's varlen graphs.
target_only = get_attn_cg_support(
groups,
None, # type: ignore[arg-type]
None,
checked_layer_names={"target"},
)
assert target_only.min_cg_support == AttentionCGSupport.ALWAYS
@@ -176,7 +176,7 @@ def test_attention_checks_preserve_global_and_target_scoped_support():
draft_group.layer_names.append("target")
target_with_shared_group = get_attn_cg_support(
groups,
None, # type: ignore[arg-type]
None,
checked_layer_names={"target"},
)
assert target_with_shared_group.min_cg_support == AttentionCGSupport.UNIFORM_BATCH
+4 -6
View File
@@ -39,9 +39,7 @@ def _make_connector(
kv_role="kv_consumer",
kv_buffer_device="cpu",
)
connector = ActiveKVConnector( # type: ignore[arg-type]
SimpleNamespace(kv_transfer_config=kv_config), {}
)
connector = ActiveKVConnector(SimpleNamespace(kv_transfer_config=kv_config), {})
events.clear()
return connector
@@ -66,7 +64,7 @@ def test_load_start_phase(
request_indices = torch.tensor([3, 1])
request_ids = ["first", "second"]
attn_metadata = {"layer": object()}
connector.pre_forward( # type: ignore[arg-type]
connector.pre_forward(
output,
request_state_indices=request_indices,
request_ids=request_ids,
@@ -85,7 +83,7 @@ def test_load_start_phase(
assert kwargs["attn_metadata"] is attn_metadata
# A subsequent step without a forward must not reuse the prior batch.
connector.no_forward(_scheduler_output(False)) # type: ignore[arg-type]
connector.no_forward(_scheduler_output(False))
assert connector.kv_connector.start_load_kv.call_count == 2
assert connector.kv_connector.start_load_kv.call_args.kwargs == {}
@@ -94,6 +92,6 @@ def test_no_forward_starts_deferred_load_once(monkeypatch: pytest.MonkeyPatch):
events: list[str] = []
connector = _make_connector(monkeypatch, events)
connector.no_forward(_scheduler_output(False)) # type: ignore[arg-type]
connector.no_forward(_scheduler_output(False))
assert events == ["handle", "bind", "start", "wait", "clear"]
@@ -75,7 +75,7 @@ def _make_worker(engine: _RecordingEngine | None) -> Worker:
def test_reload_weights_sets_current_config():
worker = _make_worker(None)
model_runner = _RecordingModelRunner()
worker.model_runner = model_runner # type: ignore[assignment]
worker.model_runner = model_runner
Worker.reload_weights(worker)
@@ -142,7 +142,7 @@ def test_invalid_query_uses_raises():
mode=LATE_INTERACTION_MODE_CACHE_QUERY,
query_key="query-bad",
)
bad_meta.query_uses = "bad-int" # type: ignore[assignment]
bad_meta.query_uses = "bad-int"
bad_query_params = _make_pooling_params(bad_meta)
with pytest.raises(ValueError, match="must be an integer value"):