diff options
| author | 2020-03-03 21:39:42 -0500 | |
|---|---|---|
| committer | 2020-03-03 21:39:42 -0500 | |
| commit | e5566eb328954eb0b6026ff7968f06223a9a8d7a (patch) | |
| tree | 6105463e33faf55ca4df458a65d2a7116df426f8 /tests/base.py | |
| parent | !roles Command Test: Applied !roles command changes (diff) | |
| parent | Merge pull request #750 from python-discord/bug/backend/b748/resolver-in-coro (diff) | |
Merge branch 'master' into roles-command-pagination
Diffstat (limited to 'tests/base.py')
| -rw-r--r-- | tests/base.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/base.py b/tests/base.py index 88693f382..42174e911 100644 --- a/tests/base.py +++ b/tests/base.py @@ -22,8 +22,13 @@ class _CaptureLogHandler(logging.Handler): self.records.append(record) -class LoggingTestCase(unittest.TestCase): - """TestCase subclass that adds more logging assertion tools.""" +class LoggingTestsMixin: + """ + A mixin that defines additional test methods for logging behavior. + + This mixin relies on the availability of the `fail` attribute defined by the + test classes included in Python's unittest method to signal test failure. + """ @contextmanager def assertNotLogs(self, logger=None, level=None, msg=None): @@ -73,10 +78,9 @@ class LoggingTestCase(unittest.TestCase): self.fail(msg) -class CommandTestCase(unittest.TestCase): +class CommandTestCase(unittest.IsolatedAsyncioTestCase): """TestCase with additional assertions that are useful for testing Discord commands.""" - @helpers.async_test async def assertHasPermissionsCheck( self, cmd: commands.Command, |