aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-05-09 10:36:53 -0400
committerMarcoFalke <falke.marco@gmail.com>2019-05-16 16:15:49 -0400
commit8f215c7a270066b315060a112fe69d968ab8b292 (patch)
tree83e825f1a531058ac79125b142969346f8bcef40 /test
parent9c1a607a092039ada85aa7a8c12c6062a8e89b94 (diff)
downloadbitcoin-8f215c7a270066b315060a112fe69d968ab8b292.tar.xz
test: Format predicate source as multiline on error
Github-Pull: #15990 Rebased-From: fa3872e7b4540857261aed948b94b6b2bfdbc3d1
Diffstat (limited to 'test')
-rw-r--r--test/functional/test_framework/util.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py
index fef9982412..87e2dbaf16 100644
--- a/test/functional/test_framework/util.py
+++ b/test/functional/test_framework/util.py
@@ -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))