Skip to content

Commit 0814a4f

Browse files
committed
Stop passing the loop arg around in in test_spawning_external_process
1 parent fde5d14 commit 0814a4f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/test_process_spawning.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ def test_spawning_external_process(self):
1515
cause loop freeze."""
1616

1717
async def run(loop):
18-
event = asyncio.Event(loop=loop)
18+
event = asyncio.Event()
1919

2020
dummy_workers = [simulate_loop_activity(loop, event)
2121
for _ in range(5)]
2222
spawn_worker = spawn_external_process(loop, event)
23-
done, pending = await asyncio.wait([spawn_worker] + dummy_workers,
24-
loop=loop)
23+
done, pending = await asyncio.wait([spawn_worker] + dummy_workers)
2524
exceptions = [result.exception()
2625
for result in done if result.exception()]
2726
if exceptions:
@@ -33,8 +32,7 @@ async def simulate_loop_activity(loop, done_event):
3332
"""Simulate loop activity by busy waiting for event."""
3433
while True:
3534
try:
36-
await asyncio.wait_for(done_event.wait(),
37-
timeout=0.1, loop=loop)
35+
await asyncio.wait_for(done_event.wait(), timeout=0.1)
3836
except asyncio.TimeoutError:
3937
pass
4038

@@ -45,7 +43,7 @@ async def spawn_external_process(loop, event):
4543
executor = ThreadPoolExecutor()
4644
try:
4745
call = loop.run_in_executor(executor, spawn_process)
48-
await asyncio.wait_for(call, loop=loop, timeout=3600)
46+
await asyncio.wait_for(call, timeout=3600)
4947
finally:
5048
event.set()
5149
executor.shutdown(wait=False)

0 commit comments

Comments
 (0)