Skip to content

πŸš€ The fast, Pythonic way to build MCP servers and clients.

Remove asyncio mark

Jeremiah Lowin96194bd40f35
diff --git a/tests/contrib/test_component_manager.py b/tests/contrib/test_component_manager.py
index 8fea3c8bc..0059cb214 100644
--- a/tests/contrib/test_component_manager.py
+++ b/tests/contrib/test_component_manager.py
@@ -566,7 +566,6 @@ class TestComponentManagerWithPath:
def client_with_path(self, mcp_with_path):
return TestClient(mcp_with_path.http_app())
- @pytest.mark.asyncio
async def test_enable_tool_route_with_path(self, client_with_path, mcp_with_path):
tool = await mcp_with_path._tool_manager.get_tool("test_tool")
tool.enabled = False
@@ -576,7 +575,6 @@ class TestComponentManagerWithPath:
tool = await mcp_with_path._tool_manager.get_tool("test_tool")
assert tool.enabled is True
- @pytest.mark.asyncio
async def test_disable_resource_route_with_path(
self, client_with_path, mcp_with_path
):
@@ -592,7 +590,6 @@ class TestComponentManagerWithPath:
)
assert resource.enabled is False
- @pytest.mark.asyncio
async def test_enable_prompt_route_with_path(self, client_with_path, mcp_with_path):
prompt = await mcp_with_path._prompt_manager.get_prompt("test_prompt")
prompt.enabled = False
@@ -646,7 +643,6 @@ class TestComponentManagerWithPathAuth:
self.client = TestClient(self.mcp.http_app())
- @pytest.mark.asyncio
async def test_unauthorized_enable_tool(self):
tool = await self.mcp._tool_manager.get_tool("test_tool")
tool.enabled = False
@@ -654,7 +650,6 @@ class TestComponentManagerWithPathAuth:
assert response.status_code == 401
assert tool.enabled is False
- @pytest.mark.asyncio
async def test_forbidden_enable_tool(self):
tool = await self.mcp._tool_manager.get_tool("test_tool")
tool.enabled = False
@@ -665,7 +660,6 @@ class TestComponentManagerWithPathAuth:
assert response.status_code == 403
assert tool.enabled is False
- @pytest.mark.asyncio
async def test_authorized_enable_tool(self):
tool = await self.mcp._tool_manager.get_tool("test_tool")
tool.enabled = False
@@ -678,7 +672,6 @@ class TestComponentManagerWithPathAuth:
tool = await self.mcp._tool_manager.get_tool("test_tool")
assert tool.enabled is True
- @pytest.mark.asyncio
async def test_unauthorized_disable_resource(self):
resource = await self.mcp._resource_manager.get_resource("data://test_resource")
resource.enabled = True
@@ -686,7 +679,6 @@ class TestComponentManagerWithPathAuth:
assert response.status_code == 401
assert resource.enabled is True
- @pytest.mark.asyncio
async def test_forbidden_disable_resource(self):
resource = await self.mcp._resource_manager.get_resource("data://test_resource")
resource.enabled = True
@@ -697,7 +689,6 @@ class TestComponentManagerWithPathAuth:
assert response.status_code == 403
assert resource.enabled is True
- @pytest.mark.asyncio
async def test_authorized_disable_resource(self):
resource = await self.mcp._resource_manager.get_resource("data://test_resource")
resource.enabled = True
@@ -710,7 +701,6 @@ class TestComponentManagerWithPathAuth:
resource = await self.mcp._resource_manager.get_resource("data://test_resource")
assert resource.enabled is False
- @pytest.mark.asyncio
async def test_unauthorized_enable_prompt(self):
prompt = await self.mcp._prompt_manager.get_prompt("test_prompt")
prompt.enabled = False
@@ -718,7 +708,6 @@ class TestComponentManagerWithPathAuth:
assert response.status_code == 401
assert prompt.enabled is False
- @pytest.mark.asyncio
async def test_forbidden_enable_prompt(self):
prompt = await self.mcp._prompt_manager.get_prompt("test_prompt")
prompt.enabled = False
@@ -729,7 +718,6 @@ class TestComponentManagerWithPathAuth:
assert response.status_code == 403
assert prompt.enabled is False
- @pytest.mark.asyncio
async def test_authorized_enable_prompt(self):
prompt = await self.mcp._prompt_manager.get_prompt("test_prompt")
prompt.enabled = False
diff --git a/tests/server/openapi/test_explode_integration.py b/tests/server/openapi/test_explode_integration.py
index 3f82a98f9..8e96b5fc1 100644
--- a/tests/server/openapi/test_explode_integration.py
+++ b/tests/server/openapi/test_explode_integration.py
@@ -7,7 +7,6 @@ specifications and properly applied during HTTP request serialization.
from unittest.mock import AsyncMock, MagicMock
import httpx
-import pytest
from fastmcp.server.openapi import OpenAPITool
from fastmcp.utilities.openapi import parse_openapi_to_http_routes
@@ -130,7 +129,6 @@ class TestExplodeIntegration:
f"Expected explode=None, got {parameter.explode}"
)
- @pytest.mark.asyncio
async def test_explode_false_request_serialization(self):
"""Test that explode=false results in comma-separated query parameters in HTTP requests.
@@ -201,7 +199,6 @@ class TestExplodeIntegration:
f"Expected 'red,blue,green', got '{tags_value}'"
)
- @pytest.mark.asyncio
async def test_explode_true_request_serialization(self):
"""Test that explode=true results in separate query parameters in HTTP requests."""
openapi_spec = {
@@ -262,7 +259,6 @@ class TestExplodeIntegration:
f"Expected ['red', 'blue', 'green'], got {tags_value}"
)
- @pytest.mark.asyncio
async def test_explode_default_request_serialization(self):
"""Test that default behavior (no explode) uses explode=true for query parameters."""
openapi_spec = {