From 70c120330874a1e8d40ae28bc9954184454e3e7f Mon Sep 17 00:00:00 2001 From: Dawid Rycerz Date: Fri, 19 Dec 2025 17:39:49 +0100 Subject: refactor: improve test configuration in TaskWarrior server - Updated the import path for the `src` directory in the test configuration to use double quotes for consistency. - Enhanced the mocking of the `mcp.server.remote` module to improve test isolation. - Added spacing for better readability in the `conftest.py` file. - Ensured that the `taskwarrior_server` and `mcp_server_mock` fixtures are clearly defined with appropriate docstrings. --- servers/taskwarrior/tests/conftest.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'servers') diff --git a/servers/taskwarrior/tests/conftest.py b/servers/taskwarrior/tests/conftest.py index 5a36cc1..3ff4c0f 100644 --- a/servers/taskwarrior/tests/conftest.py +++ b/servers/taskwarrior/tests/conftest.py @@ -6,22 +6,25 @@ from unittest.mock import AsyncMock, MagicMock import pytest # Add the src directory to the Python path for testing -sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../src'))) +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../src"))) # Mock the mcp.server.remote module mock_remote = MagicMock() mock_remote.serve_remote = AsyncMock() -sys.modules['mcp.server.remote'] = mock_remote +sys.modules["mcp.server.remote"] = mock_remote if TYPE_CHECKING: from mcp_server_taskwarrior.server import TaskWarriorServer + @pytest.fixture def taskwarrior_server() -> "TaskWarriorServer": """Create a TaskWarriorServer instance for testing.""" from mcp_server_taskwarrior.server import TaskWarriorServer + return TaskWarriorServer() + @pytest.fixture def mcp_server_mock() -> MagicMock: """Create a mock MCP Server instance with all handlers.""" -- cgit v1.2.3