Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion mode/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,10 @@ def execute_from_commandline(self) -> NoReturn:
self._starting_fut = None
with exiting(file=self.stderr):
try:
self._starting_fut = asyncio.ensure_future(self.start())
self._starting_fut = asyncio.ensure_future(
self.start(),
loop=self.loop,
)
self.loop.run_until_complete(self._starting_fut)
except asyncio.CancelledError:
pass
Expand Down
2 changes: 1 addition & 1 deletion t/unit/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def test_execute_from_commandline(self, worker):
worker.execute_from_commandline()
assert excinfo.value.code == 0
assert worker._starting_fut is ensure_future.return_value
ensure_future.assert_called_once_with(worker.start.return_value)
ensure_future.assert_called_once_with(worker.start.return_value, worker.loop)
worker.stop_and_shutdown.assert_called_once_with()

def test_execute_from_commandline__MemoryError(self, worker):
Expand Down