MCPcopy Create free account
hub / github.com/microsoft/playwright-python / assert_equal

Function assert_equal

tests/sync/test_route_web_socket.py:23–36  ·  view source on GitHub ↗
(
    actual_cb: Callable[[], Union[Any, Awaitable[Any]]], expected: Any
)

Source from the content-addressed store, hash-verified

21
22
23def assert_equal(
24 actual_cb: Callable[[], Union[Any, Awaitable[Any]]], expected: Any
25) -> None:
26 __tracebackhide__ = True
27 start_time = time.time()
28 attempts = 0
29 while True:
30 actual = actual_cb()
31 if actual == expected:
32 return
33 attempts += 1
34 if time.time() - start_time > 10:
35 raise TimeoutError(f"Timed out after 10 seconds. Last actual was: {actual}")
36 time.sleep(0.1)
37
38
39def setup_ws(

Calls 1

TimeoutErrorClass · 0.85

Tested by

no test coverage detected