Skip to content

Commit

Permalink
[tests] Don't subclass from object for Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
jnewbery committed Oct 17, 2017
1 parent 8f9e362 commit f893085
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 60 deletions.
2 changes: 1 addition & 1 deletion test/functional/p2p-fullblocktest.py
Expand Up @@ -20,7 +20,7 @@
from test_framework.script import *
import struct

class PreviousSpendableOutput(object):
class PreviousSpendableOutput():
def __init__(self, tx = CTransaction(), n = -1):
self.tx = tx
self.n = n # the output we're spending
Expand Down
2 changes: 1 addition & 1 deletion test/functional/p2p-segwit.py
Expand Up @@ -89,7 +89,7 @@ def test_witness_block(self, block, accepted, with_witness=True):
assert_equal(self.connection.rpc.getbestblockhash() == block.hash, accepted)

# Used to keep track of anyone-can-spend outputs that we can use in the tests
class UTXO(object):
class UTXO():
def __init__(self, sha256, n, nValue):
self.sha256 = sha256
self.n = n
Expand Down
2 changes: 1 addition & 1 deletion test/functional/test_framework/authproxy.py
Expand Up @@ -62,7 +62,7 @@ def EncodeDecimal(o):
return str(o)
raise TypeError(repr(o) + " is not JSON serializable")

class AuthServiceProxy(object):
class AuthServiceProxy():
__id_count = 0

# ensure_ascii: escape unicode as \uXXXX, passed to json.dumps
Expand Down
4 changes: 2 additions & 2 deletions test/functional/test_framework/blockstore.py
Expand Up @@ -10,7 +10,7 @@

logger = logging.getLogger("TestFramework.blockstore")

class BlockStore(object):
class BlockStore():
"""BlockStore helper class.
BlockStore keeps a map of blocks and implements helper functions for
Expand Down Expand Up @@ -127,7 +127,7 @@ def get_locator(self, current_tip=None):
locator.vHave = r
return locator

class TxStore(object):
class TxStore():
def __init__(self, datadir):
self.txDB = dbmd.open(datadir + "/transactions", 'c')

Expand Down
6 changes: 3 additions & 3 deletions test/functional/test_framework/comptool.py
Expand Up @@ -27,7 +27,7 @@

global mininode_lock

class RejectResult(object):
class RejectResult():
"""Outcome that expects rejection of a transaction or block."""
def __init__(self, code, reason=b''):
self.code = code
Expand Down Expand Up @@ -156,13 +156,13 @@ def send_mempool(self):
# across all connections. (If outcome of final tx is specified as true
# or false, then only the last tx is tested against outcome.)

class TestInstance(object):
class TestInstance():
def __init__(self, objects=None, sync_every_block=True, sync_every_tx=False):
self.blocks_and_transactions = objects if objects else []
self.sync_every_block = sync_every_block
self.sync_every_tx = sync_every_tx

class TestManager(object):
class TestManager():

def __init__(self, testgen, datadir):
self.test_generator = testgen
Expand Down
2 changes: 1 addition & 1 deletion test/functional/test_framework/coverage.py
Expand Up @@ -14,7 +14,7 @@
REFERENCE_FILENAME = 'rpc_interface.txt'


class AuthServiceProxyWrapper(object):
class AuthServiceProxyWrapper():
"""
An object that wraps AuthServiceProxy to record specific RPC calls.
Expand Down
2 changes: 1 addition & 1 deletion test/functional/test_framework/key.py
Expand Up @@ -84,7 +84,7 @@ def _check_result(val, func, args):
ssl.EC_KEY_new_by_curve_name.restype = ctypes.c_void_p
ssl.EC_KEY_new_by_curve_name.errcheck = _check_result

class CECKey(object):
class CECKey():
"""Wrapper around OpenSSL's EC_KEY"""

POINT_CONVERSION_COMPRESSED = 2
Expand Down

0 comments on commit f893085

Please sign in to comment.