MCPcopy Index your code
hub / github.com/PabloLec/RecoverPy / assert_with_timeout

Function assert_with_timeout

tests/integration/helper.py:32–42  ·  view source on GitHub ↗
(check_func, expected, actual, timeout=10.0, interval=0.1)

Source from the content-addressed store, hash-verified

30
31
32async def assert_with_timeout(check_func, expected, actual, timeout=10.0, interval=0.1):
33 end_time = asyncio.get_event_loop().time() + timeout
34 while True:
35 if check_func():
36 return
37 if asyncio.get_event_loop().time() > end_time:
38 func_src = inspect.getsource(check_func).strip()
39 assert False, (
40 f"Timeout reached before condition in `{func_src}` became true. Expected: {expected}, Actual: {actual}"
41 )
42 await asyncio.sleep(interval)
43
44
45async def assert_current_result_is_selected_for_save(p: Pilot):

Callers 2

test_full_workflowFunction · 0.90

Calls

no outgoing calls

Tested by 2

test_full_workflowFunction · 0.72