Skip to content

Commit 4b0c47b

Browse files
tests
1 parent a54cab4 commit 4b0c47b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tests/tracing/test_misc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -647,11 +647,11 @@ def test_conversation_id_propagates_to_span_with_ai_op(
647647
assert span_data.get("gen_ai.conversation.id") == "conv-ai-op-test"
648648

649649
def test_conversation_id_propagates_to_span_with_gen_ai_op(
650-
self, sentry_init, capture_events
650+
self, sentry_init, capture_items
651651
):
652652
"""Span with gen_ai.* op should get conversation_id."""
653653
sentry_init(traces_sample_rate=1.0)
654-
events = capture_events()
654+
items = capture_items("span")
655655

656656
scope = sentry_sdk.get_current_scope()
657657
scope.set_conversation_id("conv-gen-ai-op-test")
@@ -660,8 +660,8 @@ def test_conversation_id_propagates_to_span_with_gen_ai_op(
660660
with start_span(op="gen_ai.invoke_agent"):
661661
pass
662662

663-
(event,) = events
664-
span_data = event["spans"][0]["data"]
663+
spans = [item.payload for item in items if item.type == "span"]
664+
span_data = spans[0]["attributes"]
665665
assert span_data.get("gen_ai.conversation.id") == "conv-gen-ai-op-test"
666666

667667
def test_conversation_id_not_propagated_to_non_ai_span(

0 commit comments

Comments
 (0)