Merge #15895: QA: Avoid re-reading config.ini unnecessarily

a014373d81 QA: Avoid re-reading config.ini unnecessarily (Luke Dashjr)

Pull request description:

  BitcoinTestFramework.main already loads and stores config.ini on the object itself; just access that instead of re-reading the file to check for features

ACKs for commit a01437:
  practicalswift:
    utACK a014373d81
  hebasto:
    utACK a014373d81

Tree-SHA512: 36e3dda36cf4fae243feb1655da2891d1b78c86319be9bd9809c20054fa0cb75749370b05aa9d589a4dcab6322d8cdf4e874c5175144ed23ba63b2ed338538ca
This commit is contained in:
MarcoFalke 2019-04-26 07:49:21 -04:00
commit f73a3c618b
No known key found for this signature in database
GPG key ID: D2EA4850E7528B25

View file

@ -556,21 +556,12 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
def is_cli_compiled(self): def is_cli_compiled(self):
"""Checks whether bitcoin-cli was compiled.""" """Checks whether bitcoin-cli was compiled."""
config = configparser.ConfigParser() return self.config["components"].getboolean("ENABLE_CLI")
config.read_file(open(self.options.configfile))
return config["components"].getboolean("ENABLE_CLI")
def is_wallet_compiled(self): def is_wallet_compiled(self):
"""Checks whether the wallet module was compiled.""" """Checks whether the wallet module was compiled."""
config = configparser.ConfigParser() return self.config["components"].getboolean("ENABLE_WALLET")
config.read_file(open(self.options.configfile))
return config["components"].getboolean("ENABLE_WALLET")
def is_zmq_compiled(self): def is_zmq_compiled(self):
"""Checks whether the zmq module was compiled.""" """Checks whether the zmq module was compiled."""
config = configparser.ConfigParser() return self.config["components"].getboolean("ENABLE_ZMQ")
config.read_file(open(self.options.configfile))
return config["components"].getboolean("ENABLE_ZMQ")