aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2021-10-05 22:42:24 +0100
committerGravatar GitHub <[email protected]>2021-10-05 22:42:24 +0100
commit9baf7bdb5d550eca735d6b3bcd5578126831d23a (patch)
treec45e74563ee82dffd344d63a4371989c99946464 /tests/helpers.py
parentUse `isinstance` instead of `hasattr` to determine if `Member` (diff)
parentMerge pull request #1854 from python-discord/minor-changes-to-typing-patch (diff)
Merge branch 'main' into ignore-infra-mods-errors
Diffstat (limited to 'tests/helpers.py')
-rw-r--r--tests/helpers.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/helpers.py b/tests/helpers.py
index 8443150eb..83b9b2363 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -279,7 +279,10 @@ def _get_mock_loop() -> unittest.mock.Mock:
# Since calling `create_task` on our MockBot does not actually schedule the coroutine object
# as a task in the asyncio loop, this `side_effect` calls `close()` on the coroutine object
# to prevent "has not been awaited"-warnings.
- loop.create_task.side_effect = lambda coroutine: coroutine.close()
+ def mock_create_task(coroutine, **kwargs):
+ coroutine.close()
+ return unittest.mock.Mock()
+ loop.create_task.side_effect = mock_create_task
return loop