diff --git a/test/test_base.py b/test/test_base.py index 59a026256..c9febb253 100644 --- a/test/test_base.py +++ b/test/test_base.py @@ -97,9 +97,11 @@ def wait_for_predicate(self, predicate, timeout=5 * 60, interval=5): timeout -= interval import inspect - raise Exception( - f"Timed out waiting for Truth from predicate: {inspect.getsource(predicate).strip()}" - ) + try: + source = inspect.getsource(predicate).strip() + except (TypeError, OSError): + source = repr(predicate) + raise Exception(f"Timed out waiting for Truth from predicate: {source}") def get_tank(self, index): # TODO