Skip to content

Commit

Permalink
test(test_ws.py): give some tests enough coroutine cycles under CPyth…
Browse files Browse the repository at this point in the history
…on 3.12 optimizations
  • Loading branch information
vytas7 committed Oct 14, 2023
1 parent fbac12a commit 115c110
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/asgi/test_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,9 @@ async def on_websocket(self, req, ws):
async with conductor as c:
if accept:
async with c.simulate_ws() as ws:
# Make sure the responder has a chance to reach the raise point
for _ in range(3):
await asyncio.sleep(0)
assert ws.closed
assert ws.close_code == exp_code
else:
Expand Down Expand Up @@ -1215,6 +1218,9 @@ async def handle_foobar(req, resp, ex, param): # type: ignore
async with conductor as c:
if place == 'ws_after_accept':
async with c.simulate_ws() as ws:
# Make sure the responder has a chance to reach the raise point
for _ in range(3):
await asyncio.sleep(0)
assert ws.closed
assert ws.close_code == exp_code
else:
Expand Down

0 comments on commit 115c110

Please sign in to comment.