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
@@ -413,7 +413,7 @@ def test_deepseek_v4_shared_expert_fse_uses_mtp_quantization_config_prefix(
)
compatible, reason = is_shared_expert_quant_fse_compatible(
DeepseekV4Config(), # type: ignore[arg-type]
DeepseekV4Config(),
"model.layers.2.ffn.experts",
"model.layers.2.ffn.shared_experts",
)
@@ -824,7 +824,7 @@ def test_models_fse_init(
model_type, quantization_config
)
vllm_config = VllmConfig()
vllm_config.model_config = SimpleNamespace( # type: ignore[assignment]
vllm_config.model_config = SimpleNamespace(
hf_config=config,
hf_text_config=config,
dtype=torch.bfloat16,
@@ -893,7 +893,7 @@ def test_models_fse_init(
DeepSeekV4MTP,
)
vllm_config.speculative_config = SimpleNamespace( # type: ignore[assignment]
vllm_config.speculative_config = SimpleNamespace(
draft_model_config=SimpleNamespace(hf_config=config),
method="mtp",
parallel_drafting=False,
@@ -46,7 +46,7 @@ def test_sparse_attention_refreshes_batch_state_inside_eager_segment(
with pytest.raises(BatchStateRefreshed):
DeepseekV32Attention._sparse_indexer_and_attn(
layer, # type: ignore[arg-type]
layer,
torch.empty(1, dtype=torch.long),
torch.empty(1, 1),
torch.empty(1, 1, 1),
@@ -80,7 +80,7 @@ def make_indexer_metadata(
num_decode_tokens=num_decode_tokens,
num_prefills=num_prefills,
num_prefill_tokens=num_prefill_tokens,
prefill=SimpleNamespace(chunks=[]) if num_prefills else None, # type: ignore[arg-type]
prefill=SimpleNamespace(chunks=[]) if num_prefills else None,
)
@@ -129,7 +129,7 @@ def test_short_prefill_updates_k_cache_before_scoring_decision(
slot_mapping=slot_mapping,
)
if indexer_metadata.num_decodes:
indexer_metadata.decode = object() # type: ignore[assignment]
indexer_metadata.decode = object()
mla_metadata = make_mla_metadata(
use_dense_mha=batch_kind != "force_mqa",
num_decode_tokens=mla_num_decode_tokens,
@@ -307,7 +307,7 @@ def test_deepseek_v32_dispatches_selected_mha(
output = torch.empty(2, 2)
DeepseekV32Attention._sparse_indexer_and_attn(
layer, # type: ignore[arg-type]
layer,
torch.arange(2),
torch.empty(2, 2),
q_nope,
@@ -224,11 +224,11 @@ class TestResolveClassifierActFn:
model_config = SimpleNamespace(
hf_config=SimpleNamespace(num_labels=3, problem_type="")
)
result = resolve_classifier_act_fn(model_config, act_fn=None) # type: ignore[arg-type]
result = resolve_classifier_act_fn(model_config, act_fn=None)
assert isinstance(result, PoolerClassify)
assert result.num_labels == 3
def test_passes_through_provided_act_fn(self):
custom = PoolerIdentity()
result = resolve_classifier_act_fn(None, act_fn=custom) # type: ignore[arg-type]
result = resolve_classifier_act_fn(None, act_fn=custom)
assert result is custom
@@ -320,7 +320,7 @@ def test_dispatch_seq_cls_honors_token_pooling_type(tok_pooling_type):
),
)
classifier = torch.nn.Linear(4, 3)
with set_current_vllm_config(config): # type: ignore[arg-type]
with set_current_vllm_config(config):
pooler = DispatchPooler.for_seq_cls(pooler_config, classifier=classifier)
token_ids = [[2, 99, 3, 99], [4, 99], [5, 6]]