π The fast, Pythonic way to build MCP servers and clients.
Use WindowsSelectorEventLoopPolicy to fix Windows test warnings (#2607)
Jeremiah Lowin08d092be5759
diff --git a/tests/conftest.py b/tests/conftest.pyindex 22487f97e..b45824a9e 100644--- a/tests/conftest.py+++ b/tests/conftest.py@@ -1,4 +1,6 @@+import asyncioimport socket+import sysfrom collections.abc import Callablefrom pathlib import Pathfrom typing import Any@@ -7,6 +9,11 @@ import pytestfrom fastmcp.utilities.tests import temporary_settings+# Use SelectorEventLoop on Windows to avoid ProactorEventLoop crashes+# See: https://github.com/python/cpython/issues/116773+if sys.platform == "win32":+ asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())+def pytest_collection_modifyitems(items):"""Automatically mark tests in integration_tests folder with 'integration' marker."""