From ede3d4ddf6332eb8e1ce833cdd28fd6ca7245af2 Mon Sep 17 00:00:00 2001 From: Bugen Zhao Date: Wed, 10 Jun 2026 22:12:48 +0800 Subject: [PATCH] skip tests when _rust_tool_parser is absent Signed-off-by: Bugen Zhao --- tests/tool_parsers/test_rust_tool_parser.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/tool_parsers/test_rust_tool_parser.py b/tests/tool_parsers/test_rust_tool_parser.py index 61fed9b770a..e3d8d8899a8 100644 --- a/tests/tool_parsers/test_rust_tool_parser.py +++ b/tests/tool_parsers/test_rust_tool_parser.py @@ -5,13 +5,17 @@ import json from collections.abc import Sequence from unittest.mock import MagicMock -from vllm import _rust_tool_parser +import pytest + from vllm.entrypoints.openai.chat_completion.protocol import ( ChatCompletionRequest, ChatCompletionToolsParam, ) from vllm.tool_parsers.rust_tool_parser import RustToolParser +# The PyO3 extension is an optional build artifact; skip when absent. +_rust_tool_parser = pytest.importorskip("vllm._rust_tool_parser") + MOCK_TOKENIZER = MagicMock() MOCK_TOKENIZER.get_vocab.return_value = {}