Skip to content

Commit

Permalink
test: Format predicate source as multiline on error
Browse files Browse the repository at this point in the history
Github-Pull: bitcoin#15990
Rebased-From: fa3872e
  • Loading branch information
MarcoFalke committed May 16, 2019
1 parent 9c1a607 commit 8f215c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/functional/test_framework/util.py
Expand Up @@ -219,7 +219,7 @@ def wait_until(predicate, *, attempts=float('inf'), timeout=float('inf'), lock=N
time.sleep(0.05)

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

0 comments on commit 8f215c7

Please sign in to comment.