Skip to content

Commit fa3872e

Browse files
author
MarcoFalke
committed
test: Format predicate source as multiline on error
1 parent fa1dce7 commit fa3872e

File tree

1 file changed

+1
-1
lines changed
  • test/functional/test_framework

1 file changed

+1
-1
lines changed

test/functional/test_framework/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def wait_until(predicate, *, attempts=float('inf'), timeout=float('inf'), lock=N
216216
time.sleep(0.05)
217217

218218
# Print the cause of the timeout
219-
predicate_source = inspect.getsourcelines(predicate)
219+
predicate_source = "''''\n" + inspect.getsource(predicate) + "'''"
220220
logger.error("wait_until() failed. Predicate: {}".format(predicate_source))
221221
if attempt >= attempts:
222222
raise AssertionError("Predicate {} not true after {} attempts".format(predicate_source, attempts))

0 commit comments

Comments
 (0)