Skip to content

Commit

Permalink
fix: unawaited coroutines in test start
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Bluhm <[email protected]>
  • Loading branch information
dbluhm committed Oct 27, 2023
1 parent 89e87c1 commit 6ecd912
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions aries_cloudagent/commands/tests/test_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,18 @@ async def test_start_shutdown_app(self):

def test_exec_start(self):
with mock.patch.object(
test_module, "start_app", autospec=True
# Normally this would be a CoroutineMock. However, it is awaited by
# run_loop, which is mocked out. So we mock it as a MagicMock.
test_module,
"start_app",
mock.MagicMock(),
) as start_app, mock.patch.object(
test_module, "run_loop"
) as run_loop, mock.patch.object(
test_module, "shutdown_app", autospec=True
# Same here as note above
test_module,
"shutdown_app",
mock.MagicMock(),
) as shutdown_app, mock.patch.object(
test_module, "uvloop", mock.MagicMock()
) as mock_uvloop:
Expand Down

0 comments on commit 6ecd912

Please sign in to comment.