Skip to content
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

body matcher gives no details when assertion fails #840

Open
djowett opened this issue May 23, 2024 · 2 comments
Open

body matcher gives no details when assertion fails #840

djowett opened this issue May 23, 2024 · 2 comments

Comments

@djowett
Copy link

djowett commented May 23, 2024

Is there a reason that the AssertionError in the body matcher does not supply details of the error?

It is difficult to determine some test failures without it.

This is an example of my current test output.

Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path', 'query']
Matchers failed :
headers - assertion failure :
{'Accept-Encoding': 'gzip, deflate, br', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Length': '889', 'Content-Type': 'application/json'} != {'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate, br', 'Connection': 'keep-alive', 'Content-Length': '888', 'Content-Type': 'application/json'}
body - assertion failure :

(this also applies to the raw_body matcher)

I believe this was not the case before #644

If there's no good reason to avoid it, I can provide a PR to re-add it.

@fiendish
Copy link

fiendish commented Jul 2, 2024

I would also like this. The problem is that the body could be very big and gross. So then what? deepdiff.DeepDiff?

@djowett
Copy link
Author

djowett commented Oct 29, 2024

I would also like this. The problem is that the body could be very big and gross. So then what? deepdiff.DeepDiff?

Hmm, I'm not sure maybe https://docs.python.org/3/library/difflib.html since it's in the stdlib?

My head isn't in this right now though, so I won't get to it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants