test_websocket: use _close on test_ready

This commit is contained in:
Luna 2019-03-26 23:50:10 -03:00
parent 07c66d121a
commit 0e57ad9633
1 changed files with 3 additions and 2 deletions

View File

@ -72,7 +72,7 @@ async def test_gw(test_cli):
assert isinstance(hello['d']['heartbeat_interval'], int) assert isinstance(hello['d']['heartbeat_interval'], int)
assert isinstance(hello['d']['_trace'], list) assert isinstance(hello['d']['_trace'], list)
await conn.close(1000, 'test end') await _close(conn)
@pytest.mark.asyncio @pytest.mark.asyncio
@ -94,9 +94,10 @@ async def test_ready(test_cli):
try: try:
await _json(conn) await _json(conn)
assert True assert True
await conn.close(1000, 'test end')
except (Exception, websockets.ConnectionClosed): except (Exception, websockets.ConnectionClosed):
assert False assert False
finally:
await _close(conn)
@pytest.mark.asyncio @pytest.mark.asyncio