Skip to content

Commit baed3fe

Browse files
committed
fix
1 parent e0e57a2 commit baed3fe

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/test_agent_runner_sync.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import pytest
55

6+
from agents.agent import Agent
67
from agents.run import AgentRunner
78

89

@@ -31,7 +32,7 @@ async def fake_run(self, *_args, **_kwargs):
3132
fresh_event_loop_policy.set_event_loop(test_loop)
3233

3334
try:
34-
runner.run_sync(object(), "input")
35+
runner.run_sync(Agent(name="test-agent"), "input")
3536
assert observed_loops and observed_loops[0] is test_loop
3637
finally:
3738
fresh_event_loop_policy.set_event_loop(None)
@@ -50,7 +51,7 @@ async def fake_run(self, *_args, **_kwargs):
5051

5152
fresh_event_loop_policy.set_event_loop(None)
5253

53-
runner.run_sync(object(), "input")
54+
runner.run_sync(Agent(name="test-agent"), "input")
5455
created_loop = observed_loops[0]
5556
assert created_loop is fresh_event_loop_policy.get_event_loop()
5657

@@ -68,6 +69,6 @@ async def fake_run(self, *_args, **_kwargs):
6869

6970
async def invoke():
7071
with pytest.raises(RuntimeError):
71-
runner.run_sync(object(), "input")
72+
runner.run_sync(Agent(name="test-agent"), "input")
7273

7374
asyncio.run(invoke())

0 commit comments

Comments
 (0)