Use logging in individual tests

This commit is contained in:
John Newbery
2017-03-07 18:46:17 -05:00
parent 38ad281b2a
commit 64c080051b
33 changed files with 212 additions and 224 deletions

View File

@@ -13,7 +13,6 @@ reach. [0.10 clients shouldn't request more than 16 from a single peer.]
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import logging
MAX_REQUESTS = 128
@@ -33,7 +32,6 @@ class TestManager(NodeConnCB):
def __init__(self):
NodeConnCB.__init__(self)
self.log = logging.getLogger("BlockRelayTest")
def add_new_connection(self, connection):
self.connection = connection
@@ -65,7 +63,7 @@ class TestManager(NodeConnCB):
raise AssertionError("Error, test failed: block %064x requested more than once" % key)
if total_requests > MAX_REQUESTS:
raise AssertionError("Error, too many blocks (%d) requested" % total_requests)
print("Round %d: success (total requests: %d)" % (count, total_requests))
self.log.info("Round %d: success (total requests: %d)" % (count, total_requests))
self.disconnectOkay = True
self.connection.disconnect_node()