Browse Source

pytest: Remove any existing lightning-dirs before running

This was causing some issue when automatically rerunning tests on
travis.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
parent
commit
330682abfe
  1. 4
      tests/test_lightningd.py

4
tests/test_lightningd.py

@ -8,6 +8,7 @@ import queue
import os import os
import random import random
import re import re
import shutil
import socket import socket
import sqlite3 import sqlite3
import stat import stat
@ -107,6 +108,9 @@ class NodeFactory(object):
lightning_dir = os.path.join( lightning_dir = os.path.join(
TEST_DIR, self.testname, "lightning-{}/".format(node_id)) TEST_DIR, self.testname, "lightning-{}/".format(node_id))
if os.path.exists(lightning_dir):
shutil.rmtree(lightning_dir)
socket_path = os.path.join(lightning_dir, "lightning-rpc").format(node_id) socket_path = os.path.join(lightning_dir, "lightning-rpc").format(node_id)
port = 16330 + node_id port = 16330 + node_id
daemon = utils.LightningD(lightning_dir, self.bitcoind.bitcoin_dir, port=port, random_hsm=random_hsm) daemon = utils.LightningD(lightning_dir, self.bitcoind.bitcoin_dir, port=port, random_hsm=random_hsm)

Loading…
Cancel
Save