[MyPy][3/N] Fix MyPy errors in test groups (part 3) (#55939)

Signed-off-by: Taimys <ffy2281693949@gmail.com>
Signed-off-by: Luyi Xiao <81631911+luyixiao95@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Luyi Xiao <81631911+luyixiao95@users.noreply.github.com>
Co-authored-by: Taimys <ffy2281693949@gmail.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:
Taimys
2026-09-30 11:06:07 +00:00
committed by GitHub
co-authored by Codex Luyi Xiao Taimys Harry Mellor Claude Opus 5.5
parent c4fa6f36a7
commit 5225f1bacb
118 changed files with 948 additions and 605 deletions
+7 -5
View File
@@ -218,11 +218,13 @@ def test_gptq_nfirst_weights_pass_through_for_triton():
def test_moe_wna16_setup_forwards_selected_backend(monkeypatch):
method = object.__new__(MoeWNA16Method)
method.experts_cls = object
method.experts_cls = object # type: ignore[assignment] # Opaque mocked-expert sentinel.
method.wna16_backend = WNA16MoEBackend.HUMMING
method.moe = object()
method.moe = object() # type: ignore[assignment] # Opaque mocked-config sentinel.
quant_config = object()
method.get_fused_moe_quant_config = lambda layer: quant_config
monkeypatch.setattr(
method, "get_fused_moe_quant_config", lambda layer: quant_config
)
layer = SimpleNamespace(_expert_routing_tables=lambda: (None, None, None))
captured = {}
kernel = object()
@@ -233,7 +235,7 @@ def test_moe_wna16_setup_forwards_selected_backend(monkeypatch):
monkeypatch.setattr(moe_wna16, "make_wna16_moe_kernel", fake_make_wna16_moe_kernel)
method._setup_kernel(layer)
method._setup_kernel(layer) # type: ignore[arg-type] # Routing-table stub.
assert method.moe_kernel is kernel
assert captured["backend"] == WNA16MoEBackend.HUMMING
@@ -278,7 +280,7 @@ def test_moe_wna16_uses_humming_quant_config(monkeypatch):
),
)
assert method.get_fused_moe_quant_config(layer) is quant_config
assert method.get_fused_moe_quant_config(layer) is quant_config # type: ignore[arg-type] # Identity sentinel.
@pytest.mark.skipif(