-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unclear error message #70
Comments
I have the same issue.
Why doesn't this show expected vs actual? Also, does dpytest trap output and not forward it when there's an AssertionError or something? I can't print in my code to debug (I have --capture=no for pytest and can see print statements when there ISN'T an AssertionError), and the debugger is skipping debug points when there's an AssertionError only it seems. And the bot works, I'm testing it out manually as well. I'm just trying to add a simple test for something I can see is working. |
I don't think there is a capture thing in dpytest no. So it must come from pytest directy, I don't really know. But for all that, it's more Cratspyder thing, sorry. |
The problem is that : So, what we can do, is: Maybe we could write some functions, to do that for a message, what I do is : await channel.send("Test Message")
mess = dpytest.get_message(peek=True) # peek doesnt remove the message from the queue, important for verify after
expected = "Test Message foo"
assert dpytest.verify().message().content(expected), "%s != %s" % (mess.content, expected) But yeah, maybe we can write some "easy to use" functions that implement that, I don't know |
Feel free to propose some PRs |
When testing (for example) if an embed matches what it's expected the error it's nested and doesn't give clear information about what went wrong.
For example I have this test:
The returned error is:
I don't have a text of what didn't match or what did happen. How can this be tested correctly?
The text was updated successfully, but these errors were encountered: