aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bot/exts/moderation/test_incidents.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bot/exts/moderation/test_incidents.py')
-rw-r--r--tests/bot/exts/moderation/test_incidents.py22
1 files changed, 3 insertions, 19 deletions
diff --git a/tests/bot/exts/moderation/test_incidents.py b/tests/bot/exts/moderation/test_incidents.py
index cfe0c4b03..97682163f 100644
--- a/tests/bot/exts/moderation/test_incidents.py
+++ b/tests/bot/exts/moderation/test_incidents.py
@@ -8,11 +8,11 @@ from unittest.mock import AsyncMock, MagicMock, Mock, call, patch
import aiohttp
import discord
-from async_rediscache import RedisSession
from bot.constants import Colours
from bot.exts.moderation import incidents
from bot.utils.messages import format_user
+from tests.base import RedisTestCase
from tests.helpers import (
MockAsyncWebhook, MockAttachment, MockBot, MockMember, MockMessage, MockReaction, MockRole, MockTextChannel,
MockUser
@@ -270,7 +270,7 @@ class TestAddSignals(unittest.IsolatedAsyncioTestCase):
self.incident.add_reaction.assert_not_called()
-class TestIncidents(unittest.IsolatedAsyncioTestCase):
+class TestIncidents(RedisTestCase):
"""
Tests for bound methods of the `Incidents` cog.
@@ -279,22 +279,6 @@ class TestIncidents(unittest.IsolatedAsyncioTestCase):
the instance as they wish.
"""
- session = None
-
- async def flush(self):
- """Flush everything from the database to prevent carry-overs between tests."""
- with await self.session.pool as connection:
- await connection.flushall()
-
- async def asyncSetUp(self): # noqa: N802
- self.session = RedisSession(use_fakeredis=True)
- await self.session.connect()
- await self.flush()
-
- async def asyncTearDown(self): # noqa: N802
- if self.session:
- await self.session.close()
-
def setUp(self):
"""
Prepare a fresh `Incidents` instance for each test.
@@ -656,7 +640,7 @@ class TestOnRawReactionAdd(TestIncidents):
emoji="reaction",
)
- async def asyncSetUp(self): # noqa: N802
+ async def asyncSetUp(self):
"""
Prepare an empty task and assign it as `crawl_task`.