diff --git a/tests/test_project_context_mcp_template.py b/tests/test_project_context_mcp_template.py index d5f0ae2..b88f435 100644 --- a/tests/test_project_context_mcp_template.py +++ b/tests/test_project_context_mcp_template.py @@ -14,7 +14,6 @@ from cowork_local.mcp_servers.project_context.registry import ( ) from cowork_local.mcp_servers.project_context.runtime import require_supported_python from cowork_local.mcp_servers.project_context.server import dispatch -from mcp import types EXPECTED_TOOLS = { "get_project_issue_context", @@ -88,6 +87,14 @@ def source() -> dict[str, str]: def test_template_exposes_exactly_three_provider_neutral_tools() -> None: + # The MCP SDK is a RUNTIME dependency (requirements.txt) and is deliberately + # absent from requirements-test.txt, which is all CI installs. Importing it at + # module scope aborted collection for the ENTIRE suite, so the guard lives here, + # inside the only test that touches the SDK. Guarding per-test rather than + # per-module keeps the other cases -- pure-Python contract checks that need no + # SDK -- running on CI instead of silently skipping with it. + types = pytest.importorskip("mcp.types") + assert set(TOOL_NAMES) == EXPECTED_TOOLS declarations = tool_declarations() assert {item["name"] for item in declarations} == EXPECTED_TOOLS