Skip to content

Commit

Permalink
fix: unawaited coroutines in test_upgrade
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 803fcd5 commit fb98918
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion aries_cloudagent/commands/tests/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,14 @@ async def test_execute(self):
ConnRecord, "save", mock.CoroutineMock()
), mock.patch.object(
asyncio, "get_event_loop", mock.MagicMock()
) as mock_get_event_loop:
) as mock_get_event_loop, mock.patch.object(
# Normally, this would be a CoroutingMock. However, the coroutine
# is awaited by run_until_complete, which is mocked out.
# Use MagicMock to prevent unawaited coroutine warnings.
test_module,
"upgrade",
mock.MagicMock(),
):
mock_get_event_loop.return_value = mock.MagicMock(
run_until_complete=mock.MagicMock(),
)
Expand Down

0 comments on commit fb98918

Please sign in to comment.