Skip to content

Commit 69cd7dc

Browse files
committed
Tighten test assertions
1 parent aa3e1ea commit 69cd7dc

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

tests/contrib/openai_agents/test_openai.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2565,13 +2565,10 @@ async def test_mcp_server_factory_argument(client: Client, stateful: bool):
25652565
StatelessMCPServerProvider,
25662566
)
25672567

2568-
args_seen = False
2569-
25702568
def factory(args: Optional[Any]) -> MCPServer:
25712569
print("Invoking factory: ", args)
25722570
if args is not None:
2573-
nonlocal args_seen
2574-
args_seen = True
2571+
assert args is not None
25752572
assert cast(dict[str, str], args).get("user") == "blah"
25762573

25772574
return get_tracking_server("HelloServer")
@@ -2614,7 +2611,6 @@ def factory(args: Optional[Any]) -> MCPServer:
26142611
task_queue=worker.task_queue,
26152612
execution_timeout=timedelta(seconds=30),
26162613
)
2617-
assert args_seen
26182614

26192615

26202616
async def test_stateful_mcp_server_no_worker(client: Client):

0 commit comments

Comments
 (0)