conftest.py•788 B
"""
Pytest configuration and shared fixtures for tests.
"""
import sys
import pytest
from mcp_debug_tool.schemas import StartSessionRequest
@pytest.fixture
def python_executable():
"""Return the current Python executable path."""
return sys.executable
def create_session_request(entry: str, **kwargs) -> StartSessionRequest:
"""
Helper function to create StartSessionRequest with pythonPath automatically set.
Args:
entry: Project-relative path to script
**kwargs: Additional fields (args, env, etc.)
Returns:
StartSessionRequest with pythonPath set to current Python executable
"""
if 'pythonPath' not in kwargs:
kwargs['pythonPath'] = sys.executable
return StartSessionRequest(entry=entry, **kwargs)