Skip to content

Commit

Permalink
Add failing test for aio-libs#4572
Browse files Browse the repository at this point in the history
  • Loading branch information
Fogapod committed Feb 13, 2020
1 parent f80029b commit 75b4fa6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_web_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from yarl import URL

from aiohttp import HttpVersion, web
from aiohttp.client_exceptions import ServerDisconnectedError
from aiohttp.helpers import DEBUG
from aiohttp.http_parser import RawRequestMessage
from aiohttp.streams import StreamReader
Expand Down Expand Up @@ -771,3 +772,19 @@ async def handler(request):
def test_weakref_creation() -> None:
req = make_mocked_request('GET', '/')
weakref.ref(req)


@pytest.mark.xfail(
raises=ServerDisconnectedError,
reason="see https://github.com/aio-libs/aiohttp/issues/4572"
)
async def test_handler_return_type(aiohttp_client) -> None:
async def invalid_handler_1(request):
return 1

app = web.Application()
app.router.add_get('/1', invalid_handler_1)
client = await aiohttp_client(app)

async with client.get('/1') as resp:
assert 500 == resp.status

0 comments on commit 75b4fa6

Please sign in to comment.