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
+2 -2
View File
@@ -133,7 +133,7 @@ def test_get_diff_sampling_param_includes_penalties():
},
)
diff = ModelConfig.get_diff_sampling_param(fake) # type: ignore[arg-type]
diff = ModelConfig.get_diff_sampling_param(fake)
assert diff["presence_penalty"] == 1.5
assert diff["frequency_penalty"] == 0.5
@@ -161,7 +161,7 @@ def test_generation_config_penalties_survive_diff_sampling_filter():
},
)
diff = ModelConfig.get_diff_sampling_param(fake) # type: ignore[arg-type]
diff = ModelConfig.get_diff_sampling_param(fake)
assert diff["presence_penalty"] == 1.1
assert diff["frequency_penalty"] == 0.7
+5 -5
View File
@@ -40,18 +40,18 @@ def test_supports_multimodal_inputs(model_id, limit_mm_per_prompt, expected):
def test_mm_encoder_attn_backend_str_conversion():
config = MultiModalConfig(mm_encoder_attn_backend="FLASH_ATTN") # type: ignore[arg-type]
config = MultiModalConfig(mm_encoder_attn_backend="FLASH_ATTN")
assert config.mm_encoder_attn_backend == AttentionBackendEnum.FLASH_ATTN
def test_mm_encoder_attn_backend_invalid():
with pytest.raises(ValueError):
MultiModalConfig(mm_encoder_attn_backend="not_a_backend") # type: ignore[arg-type]
MultiModalConfig(mm_encoder_attn_backend="not_a_backend")
def test_mm_hasher_algorithm_invalid():
with pytest.raises(ValueError, match="mm_hasher_algorithm"):
MultiModalConfig(mm_hasher_algorithm="md5") # type: ignore[arg-type]
MultiModalConfig(mm_hasher_algorithm="md5")
def test_mm_encoder_attn_backend_hash_updates():
@@ -560,7 +560,7 @@ def _resolve_mm_processor_device(
"""Run the `auto` resolution and report where the processor ended up."""
mm_config = MultiModalConfig(
mm_processor_kwargs={} if device is None else {"device": device},
mm_tensor_ipc=mm_tensor_ipc, # type: ignore[arg-type]
mm_tensor_ipc=mm_tensor_ipc,
)
model_config = MagicMock(spec=ModelConfig)
model_config.multimodal_config = mm_config
@@ -662,7 +662,7 @@ def _resolve_mm_video_decode_device(
the resulting video media IO kwargs."""
mm_config = MultiModalConfig(
mm_processor_kwargs={} if device is None else {"device": device},
mm_tensor_ipc=mm_tensor_ipc, # type: ignore[arg-type]
mm_tensor_ipc=mm_tensor_ipc,
media_io_kwargs={} if video_kwargs is None else {"video": dict(video_kwargs)},
)
model_config = MagicMock(spec=ModelConfig)