Closed yobuntu closed 1 year ago
Currently, there's no separate support server or such, I may make one soon. From the code you posted, the line async def test_chat_muse(bot):
won't invoke the fixture chat_bot
, the parameter needs to be exactly chat_bot
not bot
. I will likely look to set up docs soon, but it's a big task while I'm busy with college.
You are right, it was a mistake with my copy/pasting to make the minamal exemple, but even with the right fixture the second test don't pass (i edited my exemple code). Please don't wory or rush to answer me. I'm coding this bot on my spare time for fun. Good luck with the college !
It has been a long time, but I personally figured out the issue recently while writing the tests for this library. The bot
fixture should use the event_loop
fixture and create the bot like Bot("!", loop=event_loop)
. This is because pytest_asyncio doens't necessarily use the default event loop, so when the bot gets default it will end up putting its tasks on the wrong event loop, so they never run. This will be included when I add a tutorial for pytest integration
Lib and doc have been updated, I'm closing.
this test pass:
this test does not pass:
I know this is not the place to ask for support (but then where is the right place ?).
I spent quite a lot of time looking the Talos code to get how to do it but i can't make it. From what i understand, the problem come from the bot created in the fixture is not running in the test, and so the message in the test never get an answer.
Do you plan to make some code exemples (i agree to help making some documentation because your discord test framework looks very promising, and, i look forward to be able to use it).
Thank you