From 8f215c7a270066b315060a112fe69d968ab8b292 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 9 May 2019 10:36:53 -0400 Subject: test: Format predicate source as multiline on error Github-Pull: #15990 Rebased-From: fa3872e7b4540857261aed948b94b6b2bfdbc3d1 --- test/functional/test_framework/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') 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)) -- cgit v1.2.3