aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar wookie184 <[email protected]>2024-04-03 14:09:38 +0100
committerGravatar GitHub <[email protected]>2024-04-03 14:09:38 +0100
commitb28530e1821e0ed72c845c9966e8be950463279f (patch)
tree47a8c53fe36cb6b0c1341886c3858d42d904e1b7 /tests
parentBump ruff from 0.3.4 to 0.3.5 (#2998) (diff)
Fix coroutine never awaited warning in sync tests (#2996)
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/exts/backend/sync/test_cog.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/bot/exts/backend/sync/test_cog.py b/tests/bot/exts/backend/sync/test_cog.py
index bf117b478..6d7356bf2 100644
--- a/tests/bot/exts/backend/sync/test_cog.py
+++ b/tests/bot/exts/backend/sync/test_cog.py
@@ -1,3 +1,4 @@
+import types
import unittest
import unittest.mock
from unittest import mock
@@ -86,8 +87,10 @@ class SyncCogTests(SyncCogTestCase):
mock_create_task.assert_not_called()
else:
mock_create_task.assert_called_once()
- self.assertIsInstance(mock_create_task.call_args[0][0], type(self.cog.sync()))
-
+ create_task_arg = mock_create_task.call_args[0][0]
+ self.assertIsInstance(create_task_arg, types.CoroutineType)
+ self.assertEqual(create_task_arg.__qualname__, self.cog.sync.__qualname__)
+ create_task_arg.close()
async def test_sync_cog_sync_guild(self):
"""Roles and users should be synced only if a guild is successfully retrieved."""