@@ -1076,6 +1076,7 @@ def test_error_in_responses_api(sentry_init, capture_events):
10761076 )
10771077
10781078
1079+ @pytest .mark .asyncio
10791080@pytest .mark .skipif (SKIP_RESPONSES_TESTS , reason = "Responses API not available" )
10801081async def test_ai_client_span_responses_async_api (sentry_init , capture_events ):
10811082 sentry_init (
@@ -1086,7 +1087,7 @@ async def test_ai_client_span_responses_async_api(sentry_init, capture_events):
10861087 events = capture_events ()
10871088
10881089 client = AsyncOpenAI (api_key = "z" )
1089- client .responses ._post = mock . Mock (return_value = EXAMPLE_RESPONSE )
1090+ client .responses ._post = AsyncMock (return_value = EXAMPLE_RESPONSE )
10901091
10911092 with start_transaction (name = "openai tx" ):
10921093 await client .responses .create (
@@ -1115,6 +1116,7 @@ async def test_ai_client_span_responses_async_api(sentry_init, capture_events):
11151116 }
11161117
11171118
1119+ @pytest .mark .asyncio
11181120@pytest .mark .skipif (SKIP_RESPONSES_TESTS , reason = "Responses API not available" )
11191121async def test_error_in_responses_async_api (sentry_init , capture_events ):
11201122 sentry_init (
@@ -1125,7 +1127,7 @@ async def test_error_in_responses_async_api(sentry_init, capture_events):
11251127 events = capture_events ()
11261128
11271129 client = AsyncOpenAI (api_key = "z" )
1128- client .responses ._post = mock . Mock (
1130+ client .responses ._post = AsyncMock (
11291131 side_effect = OpenAIError ("API rate limit reached" )
11301132 )
11311133
0 commit comments