From 96c77124d38aa3d26fa93baf625b46ff21f4f7af Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Wed, 11 Mar 2026 18:34:12 +0100 Subject: [PATCH 1/3] test(anthropic): Stream valid JSON --- tests/integrations/anthropic/test_anthropic.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integrations/anthropic/test_anthropic.py b/tests/integrations/anthropic/test_anthropic.py index 9847df1c57..1642dcde6f 100644 --- a/tests/integrations/anthropic/test_anthropic.py +++ b/tests/integrations/anthropic/test_anthropic.py @@ -490,13 +490,13 @@ def test_streaming_create_message_with_input_json_delta( ), ContentBlockDeltaEvent( delta=InputJSONDelta( - partial_json="{'location':", type="input_json_delta" + partial_json='{"location": "', type="input_json_delta" ), index=0, type="content_block_delta", ), ContentBlockDeltaEvent( - delta=InputJSONDelta(partial_json=" 'S", type="input_json_delta"), + delta=InputJSONDelta(partial_json="S", type="input_json_delta"), index=0, type="content_block_delta", ), @@ -513,7 +513,7 @@ def test_streaming_create_message_with_input_json_delta( type="content_block_delta", ), ContentBlockDeltaEvent( - delta=InputJSONDelta(partial_json="A'}", type="input_json_delta"), + delta=InputJSONDelta(partial_json='A"}', type="input_json_delta"), index=0, type="content_block_delta", ), @@ -575,7 +575,7 @@ def test_streaming_create_message_with_input_json_delta( ) assert ( span["data"][SPANDATA.GEN_AI_RESPONSE_TEXT] - == "{'location': 'San Francisco, CA'}" + == '{"location": "San Francisco, CA"}' ) else: assert SPANDATA.GEN_AI_REQUEST_MESSAGES not in span["data"] From 0b190703695ae3c1d28d779ff0af07fc338f0155 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Wed, 11 Mar 2026 19:10:55 +0100 Subject: [PATCH 2/3] update async test --- tests/integrations/anthropic/test_anthropic.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/integrations/anthropic/test_anthropic.py b/tests/integrations/anthropic/test_anthropic.py index 1642dcde6f..de988249b3 100644 --- a/tests/integrations/anthropic/test_anthropic.py +++ b/tests/integrations/anthropic/test_anthropic.py @@ -642,15 +642,13 @@ async def test_streaming_create_message_with_input_json_delta_async( ), ContentBlockDeltaEvent( delta=InputJSONDelta( - partial_json="{'location':", type="input_json_delta" + partial_json='{"location": "', type="input_json_delta" ), index=0, type="content_block_delta", ), ContentBlockDeltaEvent( - delta=InputJSONDelta( - partial_json=" 'S", type="input_json_delta" - ), + delta=InputJSONDelta(partial_json="S", type="input_json_delta"), index=0, type="content_block_delta", ), @@ -670,7 +668,7 @@ async def test_streaming_create_message_with_input_json_delta_async( ), ContentBlockDeltaEvent( delta=InputJSONDelta( - partial_json="A'}", type="input_json_delta" + partial_json='A"}', type="input_json_delta" ), index=0, type="content_block_delta", From b02ee79dc3862d633b272f8ea61be29852a88fe7 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Wed, 11 Mar 2026 19:14:23 +0100 Subject: [PATCH 3/3] update assertion --- tests/integrations/anthropic/test_anthropic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integrations/anthropic/test_anthropic.py b/tests/integrations/anthropic/test_anthropic.py index de988249b3..e21d3bb4b0 100644 --- a/tests/integrations/anthropic/test_anthropic.py +++ b/tests/integrations/anthropic/test_anthropic.py @@ -732,7 +732,7 @@ async def test_streaming_create_message_with_input_json_delta_async( ) assert ( span["data"][SPANDATA.GEN_AI_RESPONSE_TEXT] - == "{'location': 'San Francisco, CA'}" + == '{"location": "San Francisco, CA"}' ) else: