(
actual_cb: Callable[[], Union[Any, Awaitable[Any]]], expected: Any
)
| 21 | |
| 22 | |
| 23 | def 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 | |
| 39 | def setup_ws( |
no test coverage detected