From 7da731cbe1b3f1fedc41a1cbbd5152cd450470b0 Mon Sep 17 00:00:00 2001 From: Patrick Buckley Date: Mon, 6 Jul 2026 18:18:44 -0700 Subject: [PATCH] test(mcp): narrow the escape test's waiter catch to explicit types --- tests/test_mcp_transport_owner.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_mcp_transport_owner.py b/tests/test_mcp_transport_owner.py index 53935e7a..0d6c8108 100644 --- a/tests/test_mcp_transport_owner.py +++ b/tests/test_mcp_transport_owner.py @@ -217,7 +217,10 @@ class TestTransportOwnerLifecycle: waiter_exc: BaseException | None = None try: await ready - except BaseException as e: # noqa: BLE001 - asserting the exact type below + except (Exception, _TransportLibraryEscape) as e: + # Exception covers the expected ConnectionError; the escape + # type covers the exact regression this test guards (the raw + # escape leaking to the waiter instead of being converted). waiter_exc = e await asyncio.wait({owner}, timeout=5) owner_exc = owner.exception() if owner.done() and not owner.cancelled() else None