Skip to content

Commit 0a9b2e6

Browse files
address review comments
1 parent bf3d16e commit 0a9b2e6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/server/request_handlers/test_default_request_handler.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,9 +1290,10 @@ async def single_event_stream():
12901290
def create_task_spy(coro):
12911291
nonlocal produced_task, cleanup_task
12921292
task = orig_create_task(coro)
1293-
if produced_task is None:
1293+
# Inspect the coroutine name to make the spy more robust
1294+
if coro.__name__ == '_run_event_stream':
12941295
produced_task = task
1295-
else:
1296+
elif coro.__name__ == '_cleanup_producer':
12961297
cleanup_task = task
12971298
return task
12981299

0 commit comments

Comments
 (0)