From 38b7a0e2d25da5ffbdf3342822301d8c86401791 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Tue, 5 Jun 2018 15:12:05 +0200 Subject: [PATCH] pytest: Remove directories of successful tests Signed-off-by: Christian Decker --- tests/fixtures.py | 3 +++ tests/test_lightningd.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/tests/fixtures.py b/tests/fixtures.py index 992506f95..1f6c3a4a9 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -5,6 +5,7 @@ import logging import os import pytest import re +import shutil import tempfile import utils @@ -99,6 +100,8 @@ def node_factory(directory, test_name, bitcoind, executor): if not ok: raise Exception("At least one lightning exited with unexpected non-zero return code") + shutil.rmtree(nf.directory) + def getValgrindErrors(node): for error_file in os.listdir(node.daemon.lightning_dir): diff --git a/tests/test_lightningd.py b/tests/test_lightningd.py index 7247ec19f..4704b83c6 100644 --- a/tests/test_lightningd.py +++ b/tests/test_lightningd.py @@ -337,6 +337,8 @@ class BaseLightningDTests(unittest.TestCase): if not ok: raise Exception("At least one lightning exited with unexpected non-zero return code") + shutil.rmtree(self.node_factory.directory) + class LightningDTests(BaseLightningDTests): def connect(self, may_reconnect=False):