-
Notifications
You must be signed in to change notification settings - Fork 528
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
Display response body on assertion failures #1542
Comments
Hi @FiloSottile I agree and we're going to change the actual behavior: when there is a failed assertion, we should display the body response (probably as if you have run the test with |
Awesome, thank you for the quick turnaround! ✨ |
@FiloSottile I think I've something working which is a good start. We've decided to add a new command line option With long error message, we dump the body and headers of the HTTP response: We can start with this output and tweak it latter. The reason why (pinging also @dermetfan who runs pipeline with |
The only thing missing from the Would that be accepted contribution, or it'll need to be another error-format? |
It would perhaps be easier to implement and very useful for all developers if there was a flexible way to define a name for each ENTRY that would be output instead of or along with the ENTRY_NUMBER in the event of an error. E.g. in the ENTRY:
Then you would get the output:
|
Problem to solve
Imagine I have a simple test like
When it fails, this API will print return some useful error message as a text/plain response.
However, if I run it either with
--test
or without, I will only see an HTTP code failed assertion, with no way to see the body, which I definitely need to debug and triage the test failure.Proposal
Read some limited amount of response body and if printable, display it on test failure.
The text was updated successfully, but these errors were encountered: