diff options
| author | 2019-10-15 20:18:08 +0800 | |
|---|---|---|
| committer | 2019-10-15 20:18:08 +0800 | |
| commit | 645f8f7a48657a97cb157847cd4f20e959509ebd (patch) | |
| tree | dfd64c0f504d0dc32839c68e862b6cb4fdb28bd3 /tests/helpers.py | |
| parent | Utilize __str__ of discord.Member in logging and output (diff) | |
| parent | Deployment trigger (diff) | |
Merge branch 'master' into off-topic-check
Diffstat (limited to 'tests/helpers.py')
| -rw-r--r-- | tests/helpers.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/helpers.py b/tests/helpers.py index 2908294f7..25059fa3a 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -7,6 +7,10 @@ __all__ = ('AsyncMock', 'async_test') # TODO: Remove me on 3.8 +# Allows you to mock a coroutine. Since the default `__call__` of `MagicMock` +# is not a coroutine, trying to mock a coroutine with it will result in errors +# as the default `__call__` is not awaitable. Use this class for monkeypatching +# coroutines instead. class AsyncMock(MagicMock): async def __call__(self, *args, **kwargs): return super(AsyncMock, self).__call__(*args, **kwargs) |