Closed Diapolo10 closed 1 year ago
Hmm.
Difference is we have intents.members = True
in our conftest.
Maybe try that ?
That seems to have been the main problem, yes. I'm not entirely sure why the members
intent is required here, but I suppose it doesn't matter in unit testing.
Apparently there was also another problem as I erroneously wrote
assert dpytest.verify().message().contains("VIEWING STATS FOR IRONMAN-DIA")
and missed that there was apparently a method I missed. Swapping it for
assert dpytest.verify().message().contains().content("VIEWING STATS FOR IRONMAN-DIA")
fixed the issue, and now everything is hunky-dory.
Thanks for the help, and apologies for wasting everyone's time. I need to learn to read.
I have a very bare-bones test case that fails no matter what I try. The command it's supposed to be testing does work, because I can run it manually on Discord, so I'm led to believe I've simply made a mistake in my test code somewhere. But the documentation doesn't seem to suggest there's anything wrong.
First, the versions:
dpytest
0.6.1discord.py
2.1.1Next, the error message:
It's clear that this has something to do with the "user" sending the message being the problem, but while I've tried to create a dummy user and give it to the function call as a second argument (both positional and as a keyword argument), it didn't help. It either did nothing or gave me another error about an invalid keyword argument.
Here's the entire test file,
and
conftest.py
:The full project can be found here, if you need to see the rest.
Since I didn't find anyone else complain about similar problems, I'm not sure if this is a bug in the package itself, but I figured it wouldn't hurt to try.