forked from KoalaBotUK/KoalaBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
36 lines (29 loc) · 728 Bytes
/
conftest.py
File metadata and controls
36 lines (29 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""
A configuration file for methods useful in all testing with pytest
"""
# Futures
# Built-in/Generic Imports
# Libs
import pytest
import discord
import discord.ext.commands as commands
import discord.ext.test as dpytest
import asyncio
# Own modules
import KoalaBot
# Constants
@pytest.fixture
async def bot(event_loop):
intents = discord.Intents.default()
intents.members = True
intents.guilds = True
intents.messages = True
b = commands.Bot(KoalaBot.COMMAND_PREFIX, loop=event_loop, intents=intents)
await dpytest.empty_queue()
dpytest.configure(b)
return b
@pytest.fixture(autouse=True)
def setup_is_dpytest():
KoalaBot.is_dpytest = True
yield
KoalaBot.is_dpytest = False