diff options
author | 2021-10-05 22:41:45 +0100 | |
---|---|---|
committer | 2021-10-05 22:41:45 +0100 | |
commit | 924b0631e40b0faabfcb3bd23d96345d250bb7c1 (patch) | |
tree | a1995bac234e7b583256cc4e01ea5ce86578d07e /tests/helpers.py | |
parent | Apply infractions before DMing (diff) | |
parent | Merge pull request #1854 from python-discord/minor-changes-to-typing-patch (diff) |
Merge branch 'main' into infract-then-dm
Diffstat (limited to 'tests/helpers.py')
-rw-r--r-- | tests/helpers.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/helpers.py b/tests/helpers.py index 3978076ed..47f06f292 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -278,7 +278,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 |