diff --git a/tests/conftest.py b/tests/conftest.py index 9c4f8b489..af7e47993 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,32 +1,4 @@ import pytest -from pydantic import AnyUrl - -from mcp.server.lowlevel import Server -from mcp.server.models import InitializationOptions -from mcp.types import Resource, ServerCapabilities - -TEST_INITIALIZATION_OPTIONS = InitializationOptions( - server_name="my_mcp_server", - server_version="0.1.0", - capabilities=ServerCapabilities(), -) - - -@pytest.fixture -def mcp_server() -> Server: - server = Server(name="test_server") - - @server.list_resources() - async def handle_list_resources(): - return [ - Resource( - uri=AnyUrl("memory://test"), - name="Test Resource", - description="A test resource", - ) - ] - - return server @pytest.fixture diff --git a/tests/shared/test_memory.py b/tests/shared/test_memory.py index 0a0515ca7..a0c32f556 100644 --- a/tests/shared/test_memory.py +++ b/tests/shared/test_memory.py @@ -1,4 +1,5 @@ import pytest +from pydantic import AnyUrl from typing_extensions import AsyncGenerator from mcp.client.session import ClientSession @@ -8,9 +9,27 @@ ) from mcp.types import ( EmptyResult, + Resource, ) +@pytest.fixture +def mcp_server() -> Server: + server = Server(name="test_server") + + @server.list_resources() + async def handle_list_resources(): + return [ + Resource( + uri=AnyUrl("memory://test"), + name="Test Resource", + description="A test resource", + ) + ] + + return server + + @pytest.fixture async def client_connected_to_server( mcp_server: Server,