Skip to content

Commit

Permalink
Restore test run on uvloop
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Jan 18, 2018
1 parent 79655eb commit d035426
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[pytest]
addopts= --loop=all
filterwarnings=
error
48 changes: 24 additions & 24 deletions tests/test_client_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,30 +468,30 @@ async def test_request_tracing(loop):
trace_config.on_request_end.append(on_request_end)
trace_config.on_request_redirect.append(on_request_redirect)

session = aiohttp.ClientSession(loop=loop, trace_configs=[trace_config])

resp = await session.get(
'http://example.com',
trace_request_ctx=trace_request_ctx
)

on_request_start.assert_called_once_with(
session,
trace_config_ctx,
hdrs.METH_GET,
URL("http://example.com"),
CIMultiDict()
)

on_request_end.assert_called_once_with(
session,
trace_config_ctx,
hdrs.METH_GET,
URL("http://example.com"),
CIMultiDict(),
resp
)
assert not on_request_redirect.called
async with aiohttp.ClientSession(loop=loop,
trace_configs=[trace_config]) as session:

async with await session.get(
'http://example.com',
trace_request_ctx=trace_request_ctx) as resp:

on_request_start.assert_called_once_with(
session,
trace_config_ctx,
hdrs.METH_GET,
URL("http://example.com"),
CIMultiDict()
)

on_request_end.assert_called_once_with(
session,
trace_config_ctx,
hdrs.METH_GET,
URL("http://example.com"),
CIMultiDict(),
resp
)
assert not on_request_redirect.called


async def test_request_tracing_exception(loop):
Expand Down

0 comments on commit d035426

Please sign in to comment.