diff --git a/transactron/testing/testbenchio.py b/transactron/testing/testbenchio.py index 0553184..2a769cf 100644 --- a/transactron/testing/testbenchio.py +++ b/transactron/testing/testbenchio.py @@ -88,6 +88,12 @@ async def until_done(self) -> Any: if any(res is not None for res in results): return results + async def until_all_done(self) -> Any: + """Same as `until_done` but wait for all results instead of any result.""" + async for results in self: + if all(res is not None for res in results): + return results + def __await__(self) -> Generator: only_calls = [t for t in self.calls_and_values if isinstance(t, tuple)] only_values = [t for t in self.calls_and_values if not isinstance(t, tuple)]