feat: Initial commit
This commit is contained in:
33
tests/conftest.py
Normal file
33
tests/conftest.py
Normal file
@@ -0,0 +1,33 @@
|
||||
"""Shared pytest fixtures."""
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
import pytest_asyncio
|
||||
|
||||
from mcp_api import MCPToolbox
|
||||
|
||||
FIXTURES = Path(__file__).parent / "fixtures"
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def server_config() -> dict:
|
||||
"""Config dict for the two test MCP servers, using the current Python interpreter."""
|
||||
python = sys.executable
|
||||
return {
|
||||
"echo": {
|
||||
"command": python,
|
||||
"args": [str(FIXTURES / "echo_server.py")],
|
||||
},
|
||||
"math": {
|
||||
"command": python,
|
||||
"args": [str(FIXTURES / "math_server.py")],
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@pytest_asyncio.fixture
|
||||
async def toolbox(server_config: dict) -> MCPToolbox:
|
||||
async with MCPToolbox.from_config(server_config) as tb:
|
||||
yield tb
|
||||
Reference in New Issue
Block a user