Skip to content

Commit 7481579

Browse files
committed
[tests] Make comp test framework more debuggable
Add logging so that each test prints the line number of the yield statement that generated the test.
1 parent 17f2ace commit 7481579

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/functional/test_framework/comptool.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,11 @@ def run(self):
295295
# Wait until verack is received
296296
self.wait_for_verack()
297297

298-
test_number = 1
299-
for test_instance in self.test_generator.get_tests():
298+
test_number = 0
299+
tests = self.test_generator.get_tests()
300+
for test_instance in tests:
301+
test_number += 1
302+
logger.info("Running test %d: %s line %s" % (test_number, tests.gi_code.co_filename, tests.gi_frame.f_lineno))
300303
# We use these variables to keep track of the last block
301304
# and last transaction in the tests, which are used
302305
# if we're not syncing on every block or every tx.
@@ -397,9 +400,6 @@ def run(self):
397400
if (not self.check_mempool(tx.sha256, tx_outcome)):
398401
raise AssertionError("Mempool test failed at test %d" % test_number)
399402

400-
logger.info("Test %d: PASS" % test_number)
401-
test_number += 1
402-
403403
[ c.disconnect_node() for c in self.connections ]
404404
self.wait_for_disconnections()
405405
self.block_store.close()

0 commit comments

Comments
 (0)