Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/test_framework.py
Show First 20 Lines • Show All 469 Lines • ▼ Show 20 Lines | def _initialize_chain_clean(self): | ||||
initialize_datadir(self.options.tmpdir, i) | initialize_datadir(self.options.tmpdir, i) | ||||
class SkipTest(Exception): | class SkipTest(Exception): | ||||
"""This exception is raised to skip a test""" | """This exception is raised to skip a test""" | ||||
def __init__(self, message): | def __init__(self, message): | ||||
self.message = message | self.message = message | ||||
def skip_if_no_py3_zmq(): | |||||
"""Attempt to import the zmq package and skip the test if the import fails.""" | |||||
try: | |||||
import zmq # noqa | |||||
except ImportError: | |||||
raise SkipTest("python3-zmq module not available.") | |||||
def skip_if_no_bitcoind_zmq(test_instance): | |||||
"""Skip the running test if bitcoind has not been compiled with zmq support.""" | |||||
config = configparser.ConfigParser() | |||||
config.read_file(open(test_instance.options.configfile, encoding='utf-8')) | |||||
if not config["components"].getboolean("ENABLE_ZMQ"): | |||||
raise SkipTest("bitcoind has not been built with zmq enabled.") |