From f32b983f58e6060dc2ac0440df81ba2643e2778f Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Mon, 24 Aug 2026 08:41:10 -0400 Subject: [PATCH] test: Access the 'type' in an event using `.get` `select_transactions_with_mcp_spans` assumes that all events provided to the helper are transactions and contain a `type` key. However, not all events contain 'type's and so passing events that may contain a log would raise a KeyError. --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 312c992e6b..741aec1938 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1039,7 +1039,7 @@ def inner(events, method_name): return [ transaction for transaction in events - if transaction["type"] == "transaction" + if transaction.get("type") == "transaction" and any( span["data"].get("mcp.method.name") == method_name for span in transaction.get("spans", [])