You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When writing my tests I need to debug why an AssertionError is raised when verifying a message. I can't know what message is being verified so I can't debug the bot/cog.
Describe the solution you'd like
A clear diff between the expected message content (passed as parameter) and the message sent by the bot, as pytest/python do:
E assert <discord.ext.test.verify.VerifyMessage object at 0x7fe857f5d840>
E + where <discord.ext.test.verify.VerifyMessage object at 0x7fe857f5d840> = <bound method VerifyMessage.content of <discord.ext.test.verify.VerifyMessage object at 0x7fe857f5d840>>("isn't in the database")
E + where <bound method VerifyMessage.content of <discord.ext.test.verify.VerifyMessage object at 0x7fe857f5d840>> = <discord.ext.test.verify.VerifyMessage object at 0x7fe857f5d840>.content
E + where <discord.ext.test.verify.VerifyMessage object at 0x7fe857f5d840> = <bound method VerifyMessage.contains of <discord.ext.test.verify.VerifyMessage object at 0x7fe857f5d840>>()
E + where <bound method VerifyMessage.contains of <discord.ext.test.verify.VerifyMessage object at 0x7fe857f5d840>> = <discord.ext.test.verify.VerifyMessage object at 0x7fe857f5d840>.contains
E + where <discord.ext.test.verify.VerifyMessage object at 0x7fe857f5d840> = <bound method Verify.message of <discord.ext.test.verify.Verify object at 0x7fe857f5dd50>>()
E + where <bound method Verify.message of <discord.ext.test.verify.Verify object at 0x7fe857f5dd50>> = <discord.ext.test.verify.Verify object at 0x7fe857f5dd50>.message
E + where <discord.ext.test.verify.Verify object at 0x7fe857f5dd50> = <function verify at 0x7fe8582cab90>()
E + where <function verify at 0x7fe8582cab90> = dpytest.verify
Maybe at least writing a better __str__ or __repr__ for the Verify* classes could be a solution
The text was updated successfully, but these errors were encountered:
ctmbl
changed the title
A
Add better AssertionError messages when using dpytest.verify()Jun 7, 2023
Is your feature request related to a problem? Please describe.
When writing my tests I need to debug why an AssertionError is raised when
verify
ing a message. I can't know what message is being verified so I can't debug the bot/cog.Describe the solution you'd like
A clear diff between the expected message content (passed as parameter) and the message sent by the bot, as pytest/python do:
Describe alternatives you've considered
Currently it looks like:
Maybe at least writing a better
__str__
or__repr__
for theVerify*
classes could be a solutionThe text was updated successfully, but these errors were encountered: