conftest.py•659 B
"""Pytest configuration and fixtures."""
import os
import pytest
from tests.mcp_client import MCPClient
DEFAULT_MCP_URL = "http://localhost:8080/"
def pytest_addoption(parser):
"""Add custom command line options."""
parser.addoption(
"--mcp-url",
action="store",
default=os.getenv("MCP_URL", DEFAULT_MCP_URL),
help="MCP server URL to test",
)
@pytest.fixture
def mcp_url(request):
"""Get MCP server URL from command line or environment."""
return request.config.getoption("--mcp-url")
@pytest.fixture
def mcp_client(mcp_url):
"""Create MCP client for testing."""
return MCPClient(mcp_url)