Skip to content

Commit 39a5f25

Browse files
committed
fix(test): skip MCP tests on Python 3.9
The MCP module is only available on Python 3.10+. Add skipif marker to TestFetchMcpToolsInternal class to prevent ModuleNotFoundError on Python 3.9 CI runs.
1 parent 2460dcf commit 39a5f25

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/test_toolset_mcp.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
from __future__ import annotations
22

3+
import sys
34
from contextlib import asynccontextmanager
45
from unittest.mock import AsyncMock, MagicMock, patch
56

67
import pytest
78

89
from stackone_ai.toolset import StackOneToolSet, _fetch_mcp_tools, _McpToolDefinition
910

11+
# MCP module requires Python 3.10+
12+
SKIP_MCP_TESTS = sys.version_info < (3, 10)
13+
1014

1115
@pytest.fixture
1216
def mock_mcp_catalog(monkeypatch):
@@ -323,6 +327,7 @@ def fake_fetch(_: str, headers: dict[str, str]) -> list[_McpToolDefinition]:
323327
toolset.fetch_tools()
324328

325329

330+
@pytest.mark.skipif(SKIP_MCP_TESTS, reason="MCP module requires Python 3.10+")
326331
class TestFetchMcpToolsInternal:
327332
"""Test _fetch_mcp_tools internal implementation."""
328333

0 commit comments

Comments
 (0)