You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rune Tynan 6cd8dd70e3
Bump version
2 months ago
discord/ext/test Bump version 2 months ago
docs Add missing module autodocs 6 months ago
tests Add simple tests for the case of sending plain messages, or one with an embed 6 months ago
.gitignore Merge branch 'master' into verify-embed 9 months ago
.readthedocs.yml Add sphinx version requirement 9 months ago
.travis.yml No 3.5 support 9 months ago
LICENSE Add initial functional code, ported from Talos 2 years ago Fix readthedocs link 2 months ago
dev-requirements.txt Add sphinx version requirement 9 months ago
setup.cfg Add fixture for getting a client/bot 9 months ago No 3.5 support 9 months ago


Build Status Documentation Status

This is a package to allow testing of It is only compatible with the rewrite version, and is still in early alpha. It relies on pytest-asyncio for asynchronous test running, as is coroutine driven.


Documentation can be found at, including examples and tutorials


TODO: Move this to RTD

dpytest can be used for projects using the default commands.Bot, or those defining their own subclass of bot. For someone using a custom class, code would look something like this:

import discord.ext.test as dpytest
import yourbot
import pytest

async def test_bot():
    bot = yourbot.BotClass()
    # Load any extensions/cogs you want to in here
    await dpytest.message("!help")
    dpytest.verify_message("[Expected help output]")

The dpytest framework is designed to be used best with pytest style fixtures, but is technically framework agnostic.
With pytest, the bot setup step would be moved into a fixture so each test could use that fixture. Configure will ensure that all state is reset after each call.