Skip to content

Commit efc37e1

Browse files
adapt new test
1 parent 307db73 commit efc37e1

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

tests/integrations/openai/test_openai.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2852,13 +2852,13 @@ def test_ai_client_span_responses_api(
28522852
)
28532853
@pytest.mark.skipif(SKIP_RESPONSES_TESTS, reason="Responses API not available")
28542854
def test_responses_api_conversation_id(
2855-
sentry_init, capture_events, conversation, expected_id
2855+
sentry_init, capture_items, conversation, expected_id
28562856
):
28572857
sentry_init(
28582858
integrations=[OpenAIIntegration()],
28592859
traces_sample_rate=1.0,
28602860
)
2861-
events = capture_events()
2861+
items = capture_items("span")
28622862

28632863
client = OpenAI(api_key="z")
28642864
client.responses._post = mock.Mock(return_value=EXAMPLE_RESPONSE)
@@ -2870,13 +2870,12 @@ def test_responses_api_conversation_id(
28702870
conversation=conversation,
28712871
)
28722872

2873-
(transaction,) = events
2874-
(span,) = transaction["spans"]
2873+
(span,) = (item.payload for item in items if item.type == "span")
28752874

28762875
if expected_id is None:
2877-
assert "gen_ai.conversation.id" not in span["data"]
2876+
assert "gen_ai.conversation.id" not in span["attributes"]
28782877
else:
2879-
assert span["data"]["gen_ai.conversation.id"] == expected_id
2878+
assert span["attributes"]["gen_ai.conversation.id"] == expected_id
28802879

28812880

28822881
@pytest.mark.skipif(SKIP_RESPONSES_TESTS, reason="Responses API not available")

0 commit comments

Comments
 (0)