-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add an xfailing test expecting HTTP500 for invalid handler return values #4574
Conversation
Should test for returning |
Codecov Report
@@ Coverage Diff @@
## master #4574 +/- ##
==========================================
+ Coverage 97.53% 97.57% +0.04%
==========================================
Files 43 43
Lines 8907 8907
Branches 1404 1404
==========================================
+ Hits 8687 8691 +4
+ Misses 98 96 -2
+ Partials 122 120 -2
Continue to review full report at Codecov.
|
client = await aiohttp_client(app) | ||
|
||
async with client.get('/1') as resp: | ||
assert 500 == resp.status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also check if the text includes something like "Internal Server Error".
Feel free to add a separate PR. v3.6 deprecates returning exceptions but it still works (see the red warning box): https://docs.aiohttp.org/en/stable/web_quickstart.html#exceptions master/v4.0 doesn't support this anymore and doesn't mention returning exceptions: https://docs.aiohttp.org/en/latest/web_exceptions.html Based on this, when returning errors under 4.0/master, check for HTTP 500 Internal Server Error. |
This change documents a contract of disallowing non-response
return values in request handlers that currently has a bug and
is therefore marked as xfail.
Issue: #4572
Created test as @webknjaz suggested.