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
+1 -1
View File
@@ -385,7 +385,7 @@ def test_pynvvideocodec_unrelated_error_propagates(
PyNvVideoCodecVideoBackendMixin.decode_frames_pynvvideocodec(
None,
b"video",
None, # type: ignore[arg-type] # Fails before target metadata is used.
None,
)
assert exc_info.value is original_error
+1 -1
View File
@@ -179,7 +179,7 @@ def test_audio_resampler_invalid_method(dummy_audio):
# Validated eagerly so a bad method fails at construction, not on the
# first audio request.
with pytest.raises(ValueError, match="Invalid resampling method"):
AudioResampler(target_sr=22050, method="invalid") # type: ignore[arg-type]
AudioResampler(target_sr=22050, method="invalid")
def test_audio_resampler_no_target_sr(dummy_audio):
+12 -12
View File
@@ -276,14 +276,14 @@ def test_oversized_item_is_served_uncached():
item = MultiModalKwargsItem.dummy(nbytes=4096)
small = MultiModalKwargsItem.dummy(nbytes=64)
p0_only = MultiModalProcessorOnlyCache(model_config) # type: ignore[arg-type]
p0_only = MultiModalProcessorOnlyCache(model_config)
assert p0_only.get_and_update_item((item, []), "big")[0] is item
assert not p0_only.is_cached_item("big")
assert p0_only.get_and_update_item((small, []), "small")[0] is small
assert p0_only.is_cached_item("small")
p0 = LruKeyReplicatedSenderCache(model_config) # type: ignore[arg-type]
p1 = LruKeyReplicatedReceiverCache(model_config) # type: ignore[arg-type]
p0 = LruKeyReplicatedSenderCache(model_config)
p1 = LruKeyReplicatedReceiverCache(model_config)
assert item is not None
assert p0.get_and_update_item((item, []), "big")[0] is item
assert not p0.is_cached_item("big")
@@ -304,8 +304,8 @@ def test_mm_cache_miss_raises_and_recovers():
model or network.
"""
model_config = _StubModelConfig(mm_processor_cache_gb=1)
p0 = LruKeyReplicatedSenderCache(model_config) # type: ignore[arg-type]
p1 = LruKeyReplicatedReceiverCache(model_config) # type: ignore[arg-type]
p0 = LruKeyReplicatedSenderCache(model_config)
p1 = LruKeyReplicatedReceiverCache(model_config)
mm_hash = "image_A"
item = MultiModalKwargsItem.dummy(nbytes=64)
@@ -348,7 +348,7 @@ def test_receiver_cache_replaces_stale_item_when_payload_resent():
and kills EngineCore. Prefer the fresh payload and keep it for later hits.
"""
model_config = _StubModelConfig(mm_processor_cache_gb=1)
p1 = LruKeyReplicatedReceiverCache(model_config) # type: ignore[arg-type]
p1 = LruKeyReplicatedReceiverCache(model_config)
small = MultiModalKwargsItem.dummy(nbytes=64)
large = MultiModalKwargsItem.dummy(nbytes=256)
mm_hash = "shared-id"
@@ -361,7 +361,7 @@ def test_receiver_cache_replaces_stale_item_when_payload_resent():
def test_receiver_cache_features_keep_resent_payload():
"""EngineCore updates features through get_and_update_features."""
model_config = _StubModelConfig(mm_processor_cache_gb=1)
p1 = LruKeyReplicatedReceiverCache(model_config) # type: ignore[arg-type]
p1 = LruKeyReplicatedReceiverCache(model_config)
small = MultiModalKwargsItem.dummy(nbytes=64)
large = MultiModalKwargsItem.dummy(nbytes=256)
mm_hash = "shared-id"
@@ -394,7 +394,7 @@ def test_mm_cache_miss_batches_all_drifted_hashes():
non-drifted items in the same request are still ingested.
"""
model_config = _StubModelConfig(mm_processor_cache_gb=1)
p1 = LruKeyReplicatedReceiverCache(model_config) # type: ignore[arg-type]
p1 = LruKeyReplicatedReceiverCache(model_config)
item = MultiModalKwargsItem.dummy(nbytes=64)
def _feature(
@@ -442,8 +442,8 @@ def test_shm_receiver_handles_prefix_covered_items(monkeypatch):
parallel_config=SimpleNamespace(world_size=1),
model_config=_StubModelConfig(mm_processor_cache_gb=4 * MiB_bytes / GiB_bytes),
)
p0 = ShmObjectStoreSenderCache(vllm_config) # type: ignore[arg-type]
p1 = ShmObjectStoreReceiverCache(vllm_config, mp.Lock()) # type: ignore[arg-type]
p0 = ShmObjectStoreSenderCache(vllm_config)
p1 = ShmObjectStoreReceiverCache(vllm_config, mp.Lock())
def _feature(
mm_hash: str, data: MultiModalKwargsItem | None
@@ -1082,9 +1082,9 @@ async def test_release_kv_cache_resends_mm_payload(use_async, release_error):
async def call_release():
if use_async:
await AsyncLLM.release_kv_cache_memory(engine) # type: ignore[arg-type]
await AsyncLLM.release_kv_cache_memory(engine)
else:
LLMEngine.release_kv_cache_memory(engine) # type: ignore[arg-type]
LLMEngine.release_kv_cache_memory(engine)
if release_error:
with pytest.raises(RuntimeError, match=release_error):
+4 -4
View File
@@ -1281,7 +1281,7 @@ def test_get_supported_mm_processor_kwargs_uses_supported_modalities(
processor: SimpleNamespace,
expected: dict[str, set[str]],
) -> None:
info = BaseProcessingInfo(SimpleNamespace()) # type: ignore[arg-type]
info = BaseProcessingInfo(SimpleNamespace())
info.__dict__["supported_mm_limits"] = supported_mm_limits
monkeypatch.setattr(info, "get_hf_processor", lambda **_: processor)
@@ -1291,7 +1291,7 @@ def test_get_supported_mm_processor_kwargs_uses_supported_modalities(
def test_supported_mm_processor_kwargs_is_cached(
monkeypatch: pytest.MonkeyPatch,
) -> None:
info = BaseProcessingInfo(SimpleNamespace()) # type: ignore[arg-type]
info = BaseProcessingInfo(SimpleNamespace())
expected = {"images_kwargs": {"size"}}
calls = 0
@@ -1442,7 +1442,7 @@ def test_get_merged_mm_kwargs_treats_empty_scopes_as_absent_before_routing(
mm_device_do_normalize=False,
)
model_config = SimpleNamespace(get_multimodal_config=lambda: mm_config)
ctx = InputProcessingContext(model_config, tokenizer=None) # type: ignore[arg-type]
ctx = InputProcessingContext(model_config, tokenizer=None)
merged = ctx.get_merged_mm_kwargs(
inference_kwargs,
@@ -1482,7 +1482,7 @@ def test_get_merged_mm_kwargs_merges_before_routing():
mm_device_do_normalize=False,
)
model_config = SimpleNamespace(get_multimodal_config=lambda: mm_config)
ctx = InputProcessingContext(model_config, tokenizer=None) # type: ignore[arg-type]
ctx = InputProcessingContext(model_config, tokenizer=None)
merged = ctx.get_merged_mm_kwargs(
{
+1 -1
View File
@@ -24,4 +24,4 @@ def test_create_processor_error_uses_served_model_name():
ValueError,
match="friendly-model-name is not a multimodal model",
):
MULTIMODAL_REGISTRY.create_processor(model_config) # type: ignore[arg-type]
MULTIMODAL_REGISTRY.create_processor(model_config)
+1 -1
View File
@@ -493,7 +493,7 @@ def test_pynvvideocodec_failed_rebuild_invalidates_decoder_slot():
old_decoder = FakeDecoder()
slot = PyNvVideoCodecDecoderSlot(FakeStream())
slot.decoder = old_decoder # type: ignore[assignment] # Fake retained GPU decoder.
slot.decoder = old_decoder
slot.source_path = "valid.mp4"
class FakeNvc: