File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 3939 strategy :
4040 fail-fast : false
4141 matrix :
42- python-version : [3.9 , 3.13]
42+ python-version : [3.10 , 3.13]
4343 include-extras : [true]
4444 include :
4545 - python-version : 3.9
Original file line number Diff line number Diff line change 1+ """Test for mcp server tool availability."""
2+
13import pytest
4+ import importlib .util
25import toolit .create_apps_and_register as create_apps_and_register
36
7+ mcp_spec = importlib .util .find_spec ("mcp" )
8+ mcp_installed : bool = mcp_spec is not None
9+
410
11+ @pytest .mark .skipif (not mcp_installed , reason = "mcp package is not installed" )
512@pytest .mark .asyncio
613async def test_mcp_server () -> None :
714 """Test the mcp server tool is available."""
15+ assert create_apps_and_register .mcp is not None , (
16+ "This test should only run if mcp is installed. create_apps_and_register.mcp is None indicating it is not installed."
17+ )
818
919 def some_tool () -> None :
1020 """Tool for testing purpose."""
1121 pass
1222
1323 create_apps_and_register .register_command (some_tool , name = "some_tool" )
1424 tools = await create_apps_and_register .mcp .list_tools ()
15- tool_instance = [ tool for tool in tools if tool .name == "some_tool" ][ 0 ]
25+ tool_instance = next ( tool for tool in tools if tool .name == "some_tool" )
1626 assert bool (tool_instance ) is not False
You can’t perform that action at this time.
0 commit comments