Skip to content

Commit 994b80d

Browse files
cursoragentclaude
andcommitted
tests: assert exactly one gen_ai span in streaming anthropic test
Co-Authored-By: gpt-5.3-codex-high <[email protected]>
1 parent 1edecec commit 994b80d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/integrations/anthropic/test_anthropic.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,9 @@ def test_streaming_create_message(
295295
assert event["type"] == "transaction"
296296
assert event["transaction"] == "anthropic"
297297

298-
span = next(span for span in event["spans"] if span["op"] == OP.GEN_AI_CHAT)
298+
matching_spans = [span for span in event["spans"] if span["op"] == OP.GEN_AI_CHAT]
299+
assert len(matching_spans) == 1
300+
(span,) = matching_spans
299301

300302
assert span["op"] == OP.GEN_AI_CHAT
301303
assert span["description"] == "chat model"

0 commit comments

Comments
 (0)