Skip to content
This repository was archived by the owner on Oct 1, 2021. It is now read-only.

Commit

Permalink
Fix api incompatibility with aiohttp 2.3.0
Browse files Browse the repository at this point in the history
Further reading:

  aiohttp: Drop deprecated RequestHandler.finish_connections #2006
  aio-libs/aiohttp#2006

Signed-off-by: Florian Scherf <[email protected]>
  • Loading branch information
fscherf committed Oct 19, 2017
1 parent 2a253be commit 350b86f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions aiohttp_json_rpc/pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,17 @@ def gen_rpc_context(loop, host, port, rpc, rpc_route, routes=(),
loop.run_until_complete(rpc_context.finish_connections())

# teardown server
server.close()
loop.run_until_complete(server.wait_closed())
loop.run_until_complete(app.shutdown())
loop.run_until_complete(handler.finish_connections(1))
loop.run_until_complete(app.cleanup())
async def teardown_server():
try:
server.close()
await server.wait_closed()
await app.shutdown()
await handler.shutdown(60.0)

finally:
await app.cleanup()

loop.run_until_complete(teardown_server())


@pytest.yield_fixture
Expand Down

0 comments on commit 350b86f

Please sign in to comment.