diff --git a/tests/_event_utils.py b/tests/_event_utils.py index f6674162..81c48939 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):