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:
co-authored by
Claude Opus 5.5
parent
17e9295dd5
commit
fc2c801ad9
@@ -259,7 +259,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) # type: ignore[arg-type]
|
||||
parsed_message = tool_parser.extract_tool_calls(model_output, None)
|
||||
|
||||
assert parsed_message.tools_called
|
||||
|
||||
@@ -302,7 +302,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) # type: ignore[arg-type]
|
||||
parsed = parser.extract_tool_calls(model_output, None)
|
||||
|
||||
# Assertions: the tool call is detected and the full nested JSON is parsed
|
||||
# without truncation.
|
||||
@@ -335,7 +335,7 @@ def test_mistral_function_call_nested_json():
|
||||
]
|
||||
)
|
||||
|
||||
parsed = parser.extract_tool_calls(model_output, None) # type: ignore[arg-type]
|
||||
parsed = parser.extract_tool_calls(model_output, None)
|
||||
|
||||
# Assertions: the tool call is detected and the full nested JSON is parsed
|
||||
# without truncation.
|
||||
|
||||
@@ -1193,7 +1193,7 @@ def voxtral_patch_hf_runner(hf_model: "HfRunner") -> "HfRunner":
|
||||
output.sequences = output.sequences[:, prompt_len:]
|
||||
return output
|
||||
|
||||
hf_model.get_inputs = patched_get_inputs # type: ignore[method-assign, assignment]
|
||||
hf_model.get_inputs = patched_get_inputs # type: ignore[method-assign]
|
||||
hf_model.model.generate = patched_generate # type: ignore[method-assign]
|
||||
return hf_model
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ def test_models(
|
||||
_run_test(
|
||||
hf_runner,
|
||||
vllm_runner,
|
||||
input_cases, # type: ignore[arg-type]
|
||||
input_cases,
|
||||
model,
|
||||
dtype=dtype,
|
||||
)
|
||||
|
||||
@@ -190,7 +190,7 @@ def test_models(
|
||||
_run_test(
|
||||
hf_runner,
|
||||
vllm_runner,
|
||||
input_cases, # type: ignore[arg-type]
|
||||
input_cases,
|
||||
model,
|
||||
dtype=dtype,
|
||||
)
|
||||
|
||||
@@ -149,7 +149,7 @@ def test_models(
|
||||
_run_test(
|
||||
hf_runner,
|
||||
vllm_runner,
|
||||
input_cases, # type: ignore[arg-type]
|
||||
input_cases,
|
||||
model,
|
||||
dtype=dtype,
|
||||
)
|
||||
|
||||
@@ -106,7 +106,7 @@ def test_merge_and_resolve_mm_processor_kwargs_preserves_request_alias_precedenc
|
||||
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)
|
||||
info = Qwen2VLProcessingInfo(ctx)
|
||||
monkeypatch.setattr(
|
||||
info,
|
||||
@@ -236,7 +236,7 @@ def test_get_vision_info_reads_merged_modality_scope(
|
||||
do_resize=False,
|
||||
image_processor=image_processor,
|
||||
mm_kwargs={},
|
||||
modality=modality, # type: ignore[arg-type]
|
||||
modality=modality,
|
||||
)
|
||||
|
||||
assert seen == [merged[scope]]
|
||||
|
||||
@@ -260,7 +260,7 @@ def test_quantization(
|
||||
model,
|
||||
model_impl="auto",
|
||||
enforce_eager=True,
|
||||
**quantization_kwargs, # type: ignore[arg-type]
|
||||
**quantization_kwargs,
|
||||
) as vllm_model:
|
||||
vllm_outputs = vllm_model.generate_greedy_logprobs(
|
||||
example_prompts, max_tokens=max_tokens, num_logprobs=num_logprobs
|
||||
@@ -270,7 +270,7 @@ def test_quantization(
|
||||
model,
|
||||
model_impl="transformers",
|
||||
enforce_eager=True,
|
||||
**quantization_kwargs, # type: ignore[arg-type]
|
||||
**quantization_kwargs,
|
||||
) as vllm_model:
|
||||
model_config = vllm_model.llm.llm_engine.model_config
|
||||
assert model_config.using_transformers_backend()
|
||||
|
||||
Reference in New Issue
Block a user