[MyPy][1/N] Fix mypy errors in some tests/ directories and enforce follow-imports=silent (#49570)

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Martin Hickey
2026-07-30 05:02:51 -07:00
committed by GitHub
co-authored by Harry Mellor
parent 89d97d9a16
commit 38a267cdd5
30 changed files with 166 additions and 101 deletions
@@ -261,7 +261,7 @@ def test_mistral_function_calling(vllm_runner, model: str, dtype: str) -> None:
model_output = outputs[0].outputs[0].text.strip()
assert model_output.startswith(tool_parser.bot_token), model_output
parsed_message = tool_parser.extract_tool_calls(model_output, None)
parsed_message = tool_parser.extract_tool_calls(model_output, None) # type: ignore[arg-type]
assert parsed_message.tools_called
@@ -304,7 +304,7 @@ def test_mistral_function_call_nested_json():
model_output = f"{parser.bot_token}get_current_weather{json.dumps(args_dict)}"
parsed = parser.extract_tool_calls(model_output, None)
parsed = parser.extract_tool_calls(model_output, None) # type: ignore[arg-type]
# Assertions: the tool call is detected and the full nested JSON is parsed
# without truncation.
@@ -337,7 +337,7 @@ def test_mistral_function_call_nested_json():
]
)
parsed = parser.extract_tool_calls(model_output, None)
parsed = parser.extract_tool_calls(model_output, None) # type: ignore[arg-type]
# Assertions: the tool call is detected and the full nested JSON is parsed
# without truncation.
@@ -323,7 +323,7 @@ def test_bitsandbytes_passes_revision_by_name():
return_value=["/folder/model.safetensors"],
),
):
bnb.BitsAndBytesModelLoader._prepare_weights(fake_self, "org/model", "myrev")
bnb.BitsAndBytesModelLoader._prepare_weights(fake_self, "org/model", "myrev") # type: ignore[arg-type]
mock_idx.assert_called_once()
assert mock_idx.call_args.kwargs.get("revision") == "myrev"