dpytest
dpytest copied to clipboard
A package that assists in writing tests for discord.py
I need the functionality of creating custom emojis for test guilds. I have the following test case: ```python @pytest.mark.asyncio async def test_taking_an_L(bot): config = dpytest.get_config() guild = config.guilds[0] # create...
https://github.com/CraftSpider/dpytest/issues/71 Adding new message object to the send queue allows it to be accessed from the queue
# Summary So I have this very simple block of code: ```python @pytest.mark.asyncio async def test_linkchannel_ko(bot): await dpytest.message(content=f'{bot.command_prefix}linkchannel') msg = dpytest.verify().message() expected_content = 'This command is not implemented yet.' assert...
Running edit_message doesnt update the Message object in sent_queue with the new context. This results in messages from the sent_queue not including any changes from editing messages This causes issues...
When testing (for example) if an embed matches what it's expected the error it's nested and doesn't give clear information about what went wrong. For example I have this test:...
I need to test several functions involving a custom webhook created by my bot to send messages with a custom username and avatar. (It syncs messages with an external webchat)....
## Hello! I'm trying to test that my bot properly listens for reactions and I can't seem to get it to receive the `reaction_add` event. I'm not sure if this...
So I was having an error: ```python def dict_from_user(user: discord.User) -> _types.JsonDict: out = { > 'id': user.id, 'username': user.name, 'discriminator': user.discriminator, 'avatar': user.avatar } E AttributeError: 'NoneType' object has...
Need to test a function using guild.fetch_members() and it is returning a not implemented error. ```cogs\Verification.py:494: _ _ _ _ _ _ _ _ _ _ _ _ _ _...
I wrote a test using `create_text_channel()` function. I passed `overwrites` argument to the function. Then I realized the overwrites was not be reflected. I executed following code: ```py @pytest.mark.asyncio async...