pytest: Do not check for valgrind errors if disabled

Checking for valgrind errors if we disabled valgrind will kill the
teardown, so don't!
This commit is contained in:
Christian Decker 2017-05-12 12:08:14 +02:00 committed by Rusty Russell
parent 6154020f67
commit 80486a6669

View File

@ -128,8 +128,6 @@ class BaseLightningDTests(unittest.TestCase):
self.node_factory = NodeFactory(self, self.executor)
def getValgrindErrors(self, node):
if not VALGRIND:
return None, None
error_file = '{}valgrind-errors'.format(node.daemon.lightning_dir)
with open(error_file, 'r') as f:
errors = f.read().strip()
@ -147,6 +145,9 @@ class BaseLightningDTests(unittest.TestCase):
def tearDown(self):
self.node_factory.killall()
self.executor.shutdown(wait=False)
# Do not check for valgrind error files if it is disabled
if VALGRIND:
err_count = 0
for node in self.node_factory.nodes:
err_count += self.printValgrindErrors(node)