mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
pytest: Use random ports for bitcoind and lightningd to allow parallel testing
Adds a new dependency, but totally worth it :-) Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
committed by
Rusty Russell
parent
bbeb44faac
commit
071ef628db
@@ -8,6 +8,7 @@ import time
|
||||
|
||||
from bitcoin.rpc import RawProxy as BitcoinProxy
|
||||
from decimal import Decimal
|
||||
from ephemeral_port_reserve import reserve
|
||||
|
||||
|
||||
BITCOIND_CONFIG = {
|
||||
@@ -209,9 +210,12 @@ class SimpleBitcoinProxy:
|
||||
|
||||
class BitcoinD(TailableProc):
|
||||
|
||||
def __init__(self, bitcoin_dir="/tmp/bitcoind-test", rpcport=18332):
|
||||
def __init__(self, bitcoin_dir="/tmp/bitcoind-test", rpcport=None):
|
||||
TailableProc.__init__(self, bitcoin_dir, verbose=False)
|
||||
|
||||
if rpcport is None:
|
||||
rpcport = reserve()
|
||||
|
||||
self.bitcoin_dir = bitcoin_dir
|
||||
self.rpcport = rpcport
|
||||
self.prefix = 'bitcoind'
|
||||
|
||||
Reference in New Issue
Block a user