Share one event loop per test module to stop Windows socketpair churn (#3070)
This commit is contained in:
parent
d287c9868f
commit
867bba6263
2 changed files with 60 additions and 3 deletions
|
|
@ -37,6 +37,11 @@ from mcp.client._input_required import (
|
|||
pytestmark = pytest.mark.anyio
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _module_runner_lease() -> None:
|
||||
"""Opt out of the shared per-module event loop: this module parametrizes `anyio_backend`."""
|
||||
|
||||
|
||||
def _elicit(message: str = "What is your name?") -> ElicitRequest:
|
||||
schema = {"type": "object", "properties": {"name": {"type": "string"}}, "required": ["name"]}
|
||||
return ElicitRequest(params=ElicitRequestFormParams(message=message, requested_schema=schema))
|
||||
|
|
|
|||
|
|
@ -44,6 +44,14 @@ from mcp.os.win32.utilities import FallbackProcess
|
|||
from mcp.shared.exceptions import MCPError
|
||||
from mcp.shared.message import SessionMessage
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _module_runner_lease() -> None:
|
||||
"""Opt out of the shared per-module event loop: this module parametrizes `anyio_backend`
|
||||
and calls `trio.run` directly (see the tests/conftest.py original for the Windows hazard).
|
||||
"""
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# In-process fake of the spawned server process
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Reference in a new issue