From 9e441c12bee71832bbdd97adf36b0d24c48ed6ee Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Mon, 1 Apr 2024 15:57:09 -0400 Subject: [PATCH] Additional information in case of error --- tests/_event_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/_event_utils.py b/tests/_event_utils.py index f66741626..81c489390 100644 --- a/tests/_event_utils.py +++ b/tests/_event_utils.py @@ -46,10 +46,10 @@ def events(self) -> List[TEvent]: def wait_for_events(self, count=1, timeout=10.0) -> None: """Waits for the specified number of events.""" timeout_time = time.monotonic() + timeout - for _ in range(count): + for i in range(count): remaining_time = max(0.0, timeout_time - time.monotonic()) if not self._event_semaphore.acquire(timeout=remaining_time): - raise TimeoutError("Event observer did not observe the expected number of events.") + raise TimeoutError(f"Event observer did not observe the expected number of events. {i}/{count} events") def _invoke_side_effect(self) -> None: if isinstance(self._side_effect, BaseException):