mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Adjust timeout when testing on pypy
Running the tests with coverage pytest plugin makes some tests run slower than expected
This commit is contained in:
parent
0e0f8fe01b
commit
3e0b292632
2 changed files with 10 additions and 2 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import asyncio
|
||||
import sys
|
||||
import time
|
||||
from asyncio import Event
|
||||
from dataclasses import dataclass
|
||||
|
|
@ -115,7 +116,10 @@ class TestSimpleRequestHandler:
|
|||
handler_event.clear()
|
||||
resp = await self.make_reqest(client=client)
|
||||
assert resp.status == 200
|
||||
await asyncio.wait_for(handler_event.wait(), timeout=1)
|
||||
# Running this test on PyPy with coverage pytest plugin makes the test run slower
|
||||
# than expected, so we adjust the timeout accordingly.
|
||||
timeout = 1.5 if sys.implementation.name == "pypy" else 1
|
||||
await asyncio.wait_for(handler_event.wait(), timeout=timeout)
|
||||
mocked_silent_call_request.assert_awaited()
|
||||
result = await resp.json()
|
||||
assert not result
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue