[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:
co-authored by
Codex
Luyi Xiao
Taimys
Harry Mellor
Claude Opus 5.5
parent
c4fa6f36a7
commit
5225f1bacb
@@ -4,7 +4,8 @@
|
||||
import pytest
|
||||
|
||||
from tests.reasoning.utils import run_reasoning_extraction
|
||||
from vllm.reasoning import ReasoningParser, ReasoningParserManager
|
||||
from vllm.reasoning import ReasoningParserManager
|
||||
from vllm.reasoning.step3p5_reasoning_parser import Step3p5ReasoningParser
|
||||
from vllm.tokenizers import get_tokenizer
|
||||
|
||||
parser_name = "step3p5"
|
||||
@@ -283,9 +284,8 @@ def test_reasoning(
|
||||
output_tokens: list[str] = [
|
||||
step3p5_tokenizer.convert_tokens_to_string([token]) for token in output
|
||||
]
|
||||
parser: ReasoningParser = ReasoningParserManager.get_reasoning_parser(parser_name)(
|
||||
step3p5_tokenizer
|
||||
)
|
||||
parser = ReasoningParserManager.get_reasoning_parser(parser_name)(step3p5_tokenizer)
|
||||
assert isinstance(parser, Step3p5ReasoningParser)
|
||||
|
||||
reasoning, content = run_reasoning_extraction(
|
||||
parser, output_tokens, streaming=streaming
|
||||
@@ -317,7 +317,7 @@ def test_reasoning(
|
||||
|
||||
# Test extract_content
|
||||
if param_dict["content"] is not None:
|
||||
content = parser.extract_content_ids(output_ids)
|
||||
content_ids = parser.extract_content_ids(output_ids)
|
||||
# Fixed expected token ids for specific test cases
|
||||
test_id = (
|
||||
request.node.callspec.id if hasattr(request.node, "callspec") else None
|
||||
@@ -332,7 +332,7 @@ def test_reasoning(
|
||||
expected_content_ids = step3p5_tokenizer.convert_tokens_to_ids(
|
||||
step3p5_tokenizer.tokenize(param_dict["content"])
|
||||
)
|
||||
assert content == expected_content_ids
|
||||
assert content_ids == expected_content_ids
|
||||
else:
|
||||
content = parser.extract_content_ids(output_ids)
|
||||
assert content == []
|
||||
content_ids = parser.extract_content_ids(output_ids)
|
||||
assert content_ids == []
|
||||
|
||||
Reference in New Issue
Block a user