mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
pytest: Pretty print the memleak output in tests
It wasn't JSON formatted either so there was no nice pretty-printing way. This jsonifies and pretty prints it. Signed-off-by: Christian Decker <@cdecker>
This commit is contained in:
committed by
Rusty Russell
parent
45e1f09714
commit
522c3039ec
@@ -1,3 +1,10 @@
|
||||
from bitcoin.rpc import RawProxy as BitcoinProxy
|
||||
from btcproxy import BitcoinRpcProxy
|
||||
from decimal import Decimal
|
||||
from ephemeral_port_reserve import reserve
|
||||
from lightning import LightningRpc
|
||||
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import random
|
||||
@@ -9,12 +16,6 @@ import subprocess
|
||||
import threading
|
||||
import time
|
||||
|
||||
from btcproxy import BitcoinRpcProxy
|
||||
from bitcoin.rpc import RawProxy as BitcoinProxy
|
||||
from decimal import Decimal
|
||||
from ephemeral_port_reserve import reserve
|
||||
from lightning import LightningRpc
|
||||
|
||||
BITCOIND_CONFIG = {
|
||||
"regtest": 1,
|
||||
"rpcuser": "rpcuser",
|
||||
@@ -864,7 +865,9 @@ class NodeFactory(object):
|
||||
unexpected_fail = True
|
||||
|
||||
if leaks is not None and len(leaks) != 0:
|
||||
raise Exception("Node {} has memory leaks: {}"
|
||||
.format(self.nodes[i].daemon.lightning_dir, leaks))
|
||||
raise Exception("Node {} has memory leaks: {}".format(
|
||||
self.nodes[i].daemon.lightning_dir,
|
||||
json.dumps(leaks, sort_keys=True, indent=4)
|
||||
))
|
||||
|
||||
return not unexpected_fail
|
||||
|
||||
Reference in New Issue
Block a user