From 71581ff96e5e8c92c4f53cdf33a4f5d37bfdca19 Mon Sep 17 00:00:00 2001 From: cornwarecjp Date: Mon, 29 Jan 2018 16:57:14 +0100 Subject: [PATCH] Terminate BitcoinD if, for some reason, it doesn't start properly. This cleans up the environment for future test runs. --- tests/test_lightningd.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_lightningd.py b/tests/test_lightningd.py index 70bb003e0..5f72f41b6 100644 --- a/tests/test_lightningd.py +++ b/tests/test_lightningd.py @@ -38,7 +38,13 @@ def to_json(arg): def setupBitcoind(directory): global bitcoind bitcoind = utils.BitcoinD(bitcoin_dir=directory, rpcport=28332) - bitcoind.start() + + try: + bitcoind.start() + except: + tearDownBitcoind() + raise + info = bitcoind.rpc.getblockchaininfo() # Make sure we have segwit and some funds if info['blocks'] < 432: