diff options
Diffstat (limited to 'tests/bot/exts/moderation/test_incidents.py')
-rw-r--r-- | tests/bot/exts/moderation/test_incidents.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/bot/exts/moderation/test_incidents.py b/tests/bot/exts/moderation/test_incidents.py index bb337aeba..61f64da44 100644 --- a/tests/bot/exts/moderation/test_incidents.py +++ b/tests/bot/exts/moderation/test_incidents.py @@ -17,7 +17,7 @@ from bot.utils.time import TimestampFormats, discord_timestamp from tests.base import RedisTestCase from tests.helpers import ( MockAsyncWebhook, MockAttachment, MockBot, MockMember, MockMessage, MockReaction, MockRole, MockTextChannel, - MockUser + MockUser, no_create_task ) CURRENT_TIME = datetime.datetime(2022, 1, 1, tzinfo=datetime.UTC) @@ -306,7 +306,8 @@ class TestIncidents(RedisTestCase): Note that this will not schedule `crawl_incidents` in the background, as everything is being mocked. The `crawl_task` attribute will end up being None. """ - self.cog_instance = incidents.Incidents(MockBot()) + with no_create_task(): + self.cog_instance = incidents.Incidents(MockBot()) @patch("asyncio.sleep", AsyncMock()) # Prevent the coro from sleeping to speed up the test @@ -458,7 +459,8 @@ class TestMakeConfirmationTask(TestIncidents): If this function begins to fail, first check that `created_check` is being retrieved correctly. It should be the function that is built locally in the tested method. """ - self.cog_instance.make_confirmation_task(MockMessage(id=123)) + with no_create_task(): + self.cog_instance.make_confirmation_task(MockMessage(id=123)) self.cog_instance.bot.wait_for.assert_called_once() created_check = self.cog_instance.bot.wait_for.call_args.kwargs["check"] |