Skip to content

Commit 3462f77

Browse files
committed
update other tests to use the test fixture that exists
1 parent 9ab5654 commit 3462f77

1 file changed

Lines changed: 4 additions & 20 deletions

File tree

tests/integrations/openai_agents/test_openai_agents.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,7 @@ async def test_data_collection_outputs(
12321232
capture_events,
12331233
capture_items,
12341234
test_agent,
1235+
simple_test_tool,
12351236
get_model_response,
12361237
nonstreaming_responses_tool_call_model_responses,
12371238
data_collection,
@@ -1240,11 +1241,6 @@ async def test_data_collection_outputs(
12401241
stream_gen_ai_spans,
12411242
span_streaming,
12421243
):
1243-
@agents.function_tool
1244-
def simple_test_tool(message: str) -> str:
1245-
"""A simple tool"""
1246-
return f"Tool executed with: {message}"
1247-
12481244
client = AsyncOpenAI(api_key="test-key")
12491245
model = OpenAIResponsesModel(model="gpt-4", openai_client=client)
12501246
agent_with_tool = test_agent.clone(tools=[simple_test_tool], model=model)
@@ -2815,6 +2811,7 @@ async def test_tool_execution_span(
28152811
capture_events,
28162812
capture_items,
28172813
test_agent,
2814+
simple_test_tool,
28182815
get_model_response,
28192816
nonstreaming_responses_tool_call_model_responses,
28202817
stream_gen_ai_spans,
@@ -2825,11 +2822,6 @@ async def test_tool_execution_span(
28252822
Test tool execution span creation with `AgentRunner.run()`.
28262823
"""
28272824

2828-
@agents.function_tool
2829-
def simple_test_tool(message: str) -> str:
2830-
"""A simple tool"""
2831-
return f"Tool executed with: {message}"
2832-
28332825
# Create agent with the tool
28342826
client = AsyncOpenAI(api_key="test-key")
28352827
model = OpenAIResponsesModel(model="gpt-4", openai_client=client)
@@ -3443,6 +3435,7 @@ async def test_run_streamed_tool_execution_span(
34433435
capture_events,
34443436
capture_items,
34453437
test_agent,
3438+
simple_test_tool,
34463439
get_model_response,
34473440
async_iterator,
34483441
server_side_event_chunks,
@@ -3455,11 +3448,6 @@ async def test_run_streamed_tool_execution_span(
34553448
Test tool execution span creation with `AgentRunner.run_streamed()`.
34563449
"""
34573450

3458-
@agents.function_tool
3459-
def simple_test_tool(message: str) -> str:
3460-
"""A simple tool"""
3461-
return f"Tool executed with: {message}"
3462-
34633451
# Create agent with the tool
34643452
client = AsyncOpenAI(api_key="test-key")
34653453
model = OpenAIResponsesModel(model="gpt-4", openai_client=client)
@@ -4233,6 +4221,7 @@ async def test_model_behavior_error(
42334221
capture_events,
42344222
capture_items,
42354223
test_agent,
4224+
simple_test_tool,
42364225
stream_gen_ai_spans,
42374226
span_streaming,
42384227
):
@@ -4241,11 +4230,6 @@ async def test_model_behavior_error(
42414230
The mocked API response indicates that "wrong_tool" was called.
42424231
"""
42434232

4244-
@agents.function_tool
4245-
def simple_test_tool(message: str) -> str:
4246-
"""A simple tool"""
4247-
return f"Tool executed with: {message}"
4248-
42494233
# Create agent with the tool
42504234
agent_with_tool = test_agent.clone(tools=[simple_test_tool])
42514235

0 commit comments

Comments
 (0)