Skip to content

Commit 4368a6b

Browse files
ericapisaniclaude
andcommitted
test(anthropic): Use realistic message ID in EXAMPLE_MESSAGE
Replace the generic "id" value with a realistic Anthropic message ID format to make test assertions more robust and prevent false positives from coincidental matches. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7e5363c commit 4368a6b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/integrations/anthropic/test_anthropic.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ async def __call__(self, *args, **kwargs):
5858
ANTHROPIC_VERSION = package_version("anthropic")
5959

6060
EXAMPLE_MESSAGE = Message(
61-
id="id",
61+
id="msg_01XFDUDYJgAACzvnptvVoYEL",
6262
model="model",
6363
role="assistant",
6464
content=[TextBlock(type="text", text="Hi, I'm Claude.")],
@@ -134,7 +134,7 @@ def test_nonstreaming_create_message(
134134
assert span["data"][SPANDATA.GEN_AI_USAGE_OUTPUT_TOKENS] == 20
135135
assert span["data"][SPANDATA.GEN_AI_USAGE_TOTAL_TOKENS] == 30
136136
assert span["data"][SPANDATA.GEN_AI_RESPONSE_STREAMING] is False
137-
assert span["data"][SPANDATA.GEN_AI_RESPONSE_ID] == "id"
137+
assert span["data"][SPANDATA.GEN_AI_RESPONSE_ID] == "msg_01XFDUDYJgAACzvnptvVoYEL"
138138

139139

140140
@pytest.mark.asyncio
@@ -205,7 +205,7 @@ async def test_nonstreaming_create_message_async(
205205
assert span["data"][SPANDATA.GEN_AI_USAGE_OUTPUT_TOKENS] == 20
206206
assert span["data"][SPANDATA.GEN_AI_USAGE_TOTAL_TOKENS] == 30
207207
assert span["data"][SPANDATA.GEN_AI_RESPONSE_STREAMING] is False
208-
assert span["data"][SPANDATA.GEN_AI_RESPONSE_ID] == "id"
208+
assert span["data"][SPANDATA.GEN_AI_RESPONSE_ID] == "msg_01XFDUDYJgAACzvnptvVoYEL"
209209

210210

211211
@pytest.mark.parametrize(
@@ -308,7 +308,7 @@ def test_streaming_create_message(
308308
assert span["data"][SPANDATA.GEN_AI_USAGE_OUTPUT_TOKENS] == 10
309309
assert span["data"][SPANDATA.GEN_AI_USAGE_TOTAL_TOKENS] == 20
310310
assert span["data"][SPANDATA.GEN_AI_RESPONSE_STREAMING] is True
311-
assert span["data"][SPANDATA.GEN_AI_RESPONSE_ID] == "id"
311+
assert span["data"][SPANDATA.GEN_AI_RESPONSE_ID] == "msg_01XFDUDYJgAACzvnptvVoYEL"
312312

313313

314314
@pytest.mark.asyncio
@@ -414,7 +414,7 @@ async def test_streaming_create_message_async(
414414
assert span["data"][SPANDATA.GEN_AI_USAGE_OUTPUT_TOKENS] == 10
415415
assert span["data"][SPANDATA.GEN_AI_USAGE_TOTAL_TOKENS] == 20
416416
assert span["data"][SPANDATA.GEN_AI_RESPONSE_STREAMING] is True
417-
assert span["data"][SPANDATA.GEN_AI_RESPONSE_ID] == "id"
417+
assert span["data"][SPANDATA.GEN_AI_RESPONSE_ID] == "msg_01XFDUDYJgAACzvnptvVoYEL"
418418

419419

420420
@pytest.mark.skipif(

0 commit comments

Comments
 (0)