dpytest
This is a package to allow testing of discord.py. It is only compatible with the rewrite version, and is still in early alpha.
Usage
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
def test_bot():
bot = yourbot.BotClass()
# Load any extensions/cogs you want to in here
dpytest.configure(bot)
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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dpytest-0.0.12.tar.gz.
File metadata
- Download URL: dpytest-0.0.12.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c95cef22df830b98cb02317817f18ce16299d673dcf93d40cea2afd34ffbf75
|
|
| MD5 |
a63f0da687f8c111e40144b378a8a9d3
|
|
| BLAKE2b-256 |
b3d7227743b2f04f71ffbc5fffa5f06dc61ab2b9ab2e12931a61e50c71010acd
|
File details
Details for the file dpytest-0.0.12-py3.7.egg.
File metadata
- Download URL: dpytest-0.0.12-py3.7.egg
- Upload date:
- Size: 20.8 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0465332c65557da9750ce173019d2362dc8daacc757298c0c32037e883640fd5
|
|
| MD5 |
e8151366fde7746cbe89fa064767a089
|
|
| BLAKE2b-256 |
fa2cdcbc525a39dc38a2d2772684d23a2c328df7471b795d8d415db1f46deb7e
|
File details
Details for the file dpytest-0.0.12-py3-none-any.whl.
File metadata
- Download URL: dpytest-0.0.12-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4db1ecdbf856003858995d20736900a8c5d950c0de9419e52dc031e9b1660e2c
|
|
| MD5 |
062be6d70c509321c781e226a8eaeb00
|
|
| BLAKE2b-256 |
fc57aa0855fb77db0d0b888a62aa92bd72c6ae9568db00febca73ee8f1721f9b
|