bpo-35565: Add detail to assertion failure message in wsgiref#11293
bpo-35565: Add detail to assertion failure message in wsgiref#11293rhettinger merged 2 commits intopython:masterfrom
Conversation
rhettinger
left a comment
There was a problem hiding this comment.
The core update looks good.
Usually we don't put in a test for the specific wording of an error message. This makes is easier to update in the future.
Also, minor tweaks to error messages usually don't warrant a NEWS blurb (that would result a worse signal-to-noise ratio).
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
| "AssertionError: Hop-by-hop header, 'Connection: close'," | ||
| " not allowed" | ||
| ) | ||
|
|
There was a problem hiding this comment.
Why don't simply do .. assertRaise(AssertionError ...?
There was a problem hiding this comment.
@eamanu Thanks for the review and the suggestion. I didn't do this originally to keep it consistent with the other tests (test_simple_validation_error and test_status_validation_errors). But, based on Raymond's review and your comment, I've changed it to just check that an AssertionError is raised.
There was a problem hiding this comment.
IMO the assertRaise is poorly written
|
LGTM |
|
@rhettinger Thank you for the review. Your explanations are helpful for my learning. I've changed the test to just make sure an |
|
Thanks for making the requested changes! @rhettinger: please review the changes made to this pull request. |
1 similar comment
|
Thanks for making the requested changes! @rhettinger: please review the changes made to this pull request. |
| return ["Hello, world!"] | ||
| out, err = run_amock(bad_app) | ||
| self.assertTrue(out.endswith( | ||
| b"A server error occurred. Please contact the administrator." |
There was a problem hiding this comment.
Please, remove the double whitespace on occurred. Please
| "AssertionError: Hop-by-hop header, 'Connection: close'," | ||
| " not allowed" | ||
| ) | ||
|
|
There was a problem hiding this comment.
IMO the assertRaise is poorly written
|
I am running the |
|
Removed the unneeded and incorrect test, leaving only the error message improvement. |
Add the header name and value to the assertion failure message for hop-by-hop headers.
https://bugs.python.org/issue35565