The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(tests): gate only the two AuthorizationCodeResult.code assertions on mcp 2.0
teknium1e4557d1febb7
diff --git a/tests/tools/test_mcp_oauth.py b/tests/tools/test_mcp_oauth.pyindex 8d78fbaf202..17604fc57e0 100644--- a/tests/tools/test_mcp_oauth.py+++ b/tests/tools/test_mcp_oauth.py@@ -543,7 +543,6 @@ class TestCallbackHandlerErrorEscaping:# TOCTOU port reservation (#22161)# ---------------------------------------------------------------------------[email protected]("require_mcp_2_sdk")class TestCallbackPortReservation:"""The socket picked at selection time stays bound until callback bind.@@ -578,6 +577,7 @@ class TestCallbackPortReservation:assert cfg["_resolved_port"] == 49399assert 49399 not in mod._reserved_sockets+ @pytest.mark.usefixtures("require_mcp_2_sdk") # asserts the 2.0-only AuthorizationCodeResult.codedef test_wait_for_callback_adopts_reserved_socket(self, monkeypatch):"""E2E: reserve → _wait_for_callback binds the SAME socket and thecallback round-trips through it."""@@ -611,6 +611,7 @@ class TestCallbackPortReservation:# Reservation was consumed by adoption.assert port not in mod._reserved_sockets+ @pytest.mark.usefixtures("require_mcp_2_sdk") # asserts the 2.0-only AuthorizationCodeResult.codedef test_concurrent_flows_keep_their_own_callback_ports(self, monkeypatch):"""#34260: flow A's waiter listens on A's port even after flow Boverwrites the legacy module-level global.