diff options
author | 2020-02-28 09:45:21 -0800 | |
---|---|---|
committer | 2020-02-28 09:45:21 -0800 | |
commit | a20ab7e27f06a66f1c35bdc30a54898222f7388a (patch) | |
tree | 7b15013a7f435df9583197be8bf092a2109b9fe4 /tests/helpers.py | |
parent | Merge pull request #757 from python-discord/feat/backend/b131/error-handling (diff) | |
parent | Snekbox: mention re-evaluation feature in the command's docstring (diff) |
Merge pull request #710 from python-discord/eval-enhancements
Eval cog improvements
Diffstat (limited to 'tests/helpers.py')
-rw-r--r-- | tests/helpers.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/helpers.py b/tests/helpers.py index 9d9dd5da6..6f50f6ae3 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -128,6 +128,18 @@ class AsyncMock(CustomMockMixin, unittest.mock.MagicMock): return super().__call__(*args, **kwargs) +class AsyncContextManagerMock(unittest.mock.MagicMock): + def __init__(self, return_value: Any): + super().__init__() + self._return_value = return_value + + async def __aenter__(self): + return self._return_value + + async def __aexit__(self, *args): + pass + + class AsyncIteratorMock: """ A class to mock asynchronous iterators. |