From fb98918b8e57b54623d550b51c5248367ca65885 Mon Sep 17 00:00:00 2001 From: Daniel Bluhm Date: Fri, 27 Oct 2023 15:25:07 -0400 Subject: [PATCH] fix: unawaited coroutines in test_upgrade Signed-off-by: Daniel Bluhm --- aries_cloudagent/commands/tests/test_upgrade.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/aries_cloudagent/commands/tests/test_upgrade.py b/aries_cloudagent/commands/tests/test_upgrade.py index 6814dc77d3..918b6cec4a 100644 --- a/aries_cloudagent/commands/tests/test_upgrade.py +++ b/aries_cloudagent/commands/tests/test_upgrade.py @@ -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(), )