summaryrefslogtreecommitdiff
path: root/servers/taskwarrior
diff options
context:
space:
mode:
authorDawid Rycerz <dawid@rycerz.xyz>2025-12-19 17:39:49 +0100
committerDawid Rycerz <dawid@rycerz.xyz>2025-12-19 17:39:49 +0100
commit70c120330874a1e8d40ae28bc9954184454e3e7f (patch)
tree665113211f013f209a791f19f45165e578a626f9 /servers/taskwarrior
parent3eb9e6c2724c8d5db9a4623c93ef8c96f1ba5917 (diff)
refactor: improve test configuration in TaskWarrior serverHEADmain
- 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.
Diffstat (limited to 'servers/taskwarrior')
-rw-r--r--servers/taskwarrior/tests/conftest.py7
1 files changed, 5 insertions, 2 deletions
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."""