We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ddc2a26 commit 946523dCopy full SHA for 946523d
tests/test_client_ws_functional.py
@@ -5,6 +5,7 @@
5
6
import aiohttp
7
from aiohttp import hdrs, web
8
+from aiohttp.http import WSCloseCode
9
10
if sys.version_info >= (3, 11):
11
import asyncio as async_timeout
@@ -581,12 +582,12 @@ async def handler(request):
581
582
app.router.add_route("GET", "/", handler)
583
584
client = await aiohttp_client(app)
- resp = await client.ws_connect("/", heartbeat=0.05)
585
-
586
- await resp.receive()
587
+ resp = await client.ws_connect("/", heartbeat=0.1)
588
+ # Connection should be closed roughly after 1.5x heartbeat.
+ await asyncio.sleep(0.2)
589
assert ping_received
590
+ assert resp.close_code is WSCloseCode.ABNORMAL_CLOSURE
591
592
593
async def test_send_recv_compress(aiohttp_client) -> None:
0 commit comments