-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
EDIT: just correcting a misspelling: dpytest.run_all_events -> dpytest.run_all_loops
Is your feature request related to a problem? Please describe.
I'd like to efficiently test a cog's task loop.
The documentation is lacking an example if this is already possible in some ways.
Describe the solution you'd like
I have a bot that load a cog. This cog has 2 commands, that I easily managed to test using dpytest, and 1 task loop.
One of these commands adds a user.
The task loop that regularly checks if all users' state have changed (it fetches an API (mocked)).
Here is how it should happend:
- at the beginning there is no
userthe loop shouldn't send any message - I send the command
!adduser 1, it adds the user - the loop should now fetch the
user1 state from the mocked API and send a message in the channel - I
dpytest.verifythat the last message sent was about this newuserstate --> the loop has done its job
a way to manually trigger the loop, like dpytest.run_all_events()dpytest.run_all_loops would be great I think.
Describe alternatives you've considered
I didn't considered any, I also don't know if that's currently possible
Metadata
Metadata
Assignees
Labels
No labels