File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 (
You can’t perform that action at this time.
0 commit comments