commit e4ed15f683fd8b966c41a1e4268cfa1e53ea5f6b
parent cc57da704bdbd052e5935e019e2c31af491eafda
Author: SomberNight <somber.night@protonmail.com>
Date: Thu, 2 May 2019 18:09:11 +0200
fix tests
Diffstat:
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/electrum/tests/test_lnchannel.py b/electrum/tests/test_lnchannel.py
@@ -23,6 +23,7 @@ import unittest
import os
import binascii
from pprint import pformat
+import logging
from electrum import bitcoin
from electrum import lnpeer
@@ -31,7 +32,7 @@ from electrum import lnutil
from electrum import bip32 as bip32_utils
from electrum.lnutil import SENT, LOCAL, REMOTE, RECEIVED
from electrum.ecc import sig_string_from_der_sig
-from electrum.util import set_verbosity
+from electrum.logging import console_stderr_handler
one_bitcoin_in_msat = bitcoin.COIN * 1000
@@ -185,9 +186,9 @@ class TestChannel(unittest.TestCase):
else:
self.assertFalse()
- @staticmethod
- def setUpClass():
- set_verbosity(True)
+ @classmethod
+ def setUpClass(cls):
+ console_stderr_handler.setLevel(logging.DEBUG)
def setUp(self):
# Create a test channel which will be used for the duration of this
diff --git a/electrum/tests/test_lnpeer.py b/electrum/tests/test_lnpeer.py
@@ -4,13 +4,14 @@ from decimal import Decimal
import os
from contextlib import contextmanager
from collections import defaultdict
+import logging
from electrum.network import Network
from electrum.ecc import ECPrivkey
from electrum import simple_config, lnutil
from electrum.lnaddr import lnencode, LnAddr, lndecode
from electrum.bitcoin import COIN, sha256
-from electrum.util import bh2u, set_verbosity, create_and_start_event_loop
+from electrum.util import bh2u, create_and_start_event_loop
from electrum.lnpeer import Peer
from electrum.lnutil import LNPeerAddr, Keypair, privkey_to_pubkey
from electrum.lnutil import LightningPeerConnectionClosed, RemoteMisbehaving
@@ -18,6 +19,7 @@ from electrum.lnutil import PaymentFailure, LnLocalFeatures
from electrum.lnrouter import ChannelDB, LNPathFinder
from electrum.lnworker import LNWallet
from electrum.lnmsg import encode_msg, decode_msg
+from electrum.logging import console_stderr_handler
from .test_lnchannel import create_test_channels
from . import SequentialTestCase
@@ -164,7 +166,7 @@ class TestPeer(SequentialTestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
- set_verbosity(True)
+ console_stderr_handler.setLevel(logging.DEBUG)
def setUp(self):
super().setUp()