aboutsummaryrefslogtreecommitdiffstats
path: root/tests/base.py
diff options
context:
space:
mode:
authorGravatar S. Co1 <[email protected]>2020-03-01 17:49:48 -0500
committerGravatar GitHub <[email protected]>2020-03-01 17:49:48 -0500
commit7dc7ca3427cdd4b2fd1b1083d368e80f55207d9a (patch)
tree27ab6501be3602b4a802561d5a48b96df6a6d335 /tests/base.py
parentMerge pull request #809 from python-discord/ban-grabify-urls (diff)
parentMerge branch 'master' into python38-migration (diff)
Merge pull request #783 from python-discord/python38-migration
Migrate bot to Python 3.8
Diffstat (limited to 'tests/base.py')
-rw-r--r--tests/base.py12
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,