π The fast, Pythonic way to build MCP servers and clients.
test: skip redis connection pool disconnect to fix Windows hangs
Chris Guidry0d96f88d5917
diff --git a/tests/conftest.py b/tests/conftest.pyindex 22487f97e..7c524b5ee 100644--- a/tests/conftest.py+++ b/tests/conftest.py@@ -2,12 +2,26 @@ import socketfrom collections.abc import Callablefrom pathlib import Pathfrom typing import Any+from unittest.mock import patchimport pytestfrom fastmcp.utilities.tests import temporary_settings+# Fakeredis connection pool disconnect can hang on Windows due to ProactorEventLoop+# socket shutdown issues. Since fakeredis uses in-memory connections that don't need+# proper network cleanup, we skip the disconnect entirely in tests.+async def _fast_disconnect(self):+ pass+++_disconnect_patch = patch(+ "redis.asyncio.connection.ConnectionPool.disconnect", _fast_disconnect+)+_disconnect_patch.start()++def pytest_collection_modifyitems(items):"""Automatically mark tests in integration_tests folder with 'integration' marker."""for item in items: