Skip to content

Commit

Permalink
Additional information in case of error
Browse files Browse the repository at this point in the history
  • Loading branch information
texasaggie97 committed Apr 1, 2024
1 parent 238757b commit 9e441c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/_event_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 9e441c1

Please sign in to comment.