Skip to content

Commit 255d7fa

Browse files
committed
tests: consume run_async without materializing list
1 parent fa385ab commit 255d7fa

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tests/unittests/test_runners.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -689,14 +689,12 @@ async def test_run_async_assertions_use_refetched_session_snapshot():
689689
app_name=TEST_APP_ID, user_id=TEST_USER_ID, session_id=TEST_SESSION_ID
690690
)
691691

692-
_ = [
693-
event
694-
async for event in runner.run_async(
695-
user_id=TEST_USER_ID,
696-
session_id=TEST_SESSION_ID,
697-
new_message=types.Content(role="user", parts=[types.Part(text="hi")]),
698-
)
699-
]
692+
async for _ in runner.run_async(
693+
user_id=TEST_USER_ID,
694+
session_id=TEST_SESSION_ID,
695+
new_message=types.Content(role="user", parts=[types.Part(text="hi")]),
696+
):
697+
pass
700698

701699
# InMemorySessionService returns copies; the original handle is stale after run_async.
702700
assert len(created_session.events) == 0

0 commit comments

Comments
 (0)