diff --git a/test/functional/rpc_users.py b/test/functional/rpc_users.py index 75507877d54..9e475bbe853 100755 --- a/test/functional/rpc_users.py +++ b/test/functional/rpc_users.py @@ -17,7 +17,6 @@ import urllib.parse import subprocess from random import SystemRandom import string -import configparser import sys from typing import Optional @@ -47,9 +46,7 @@ class HTTPBasicsTest(BitcoinTestFramework): self.rpcuser = "rpcuser💻" self.rpcpassword = "rpcpassword🔑" - config = configparser.ConfigParser() - config.read_file(open(self.options.configfile)) - gen_rpcauth = config['environment']['RPCAUTH'] + gen_rpcauth = self.config["environment"]["RPCAUTH"] # Generate RPCAUTH with specified password self.rt2password = "8/F3uMDw4KSEbw96U3CA1C4X05dkHDN2BPFjTgZW4KI=" diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index 6ae2cd07185..a329c66971c 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -272,9 +272,8 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): self.options.timeout_factor = self.options.timeout_factor or (4 if self.options.valgrind else 1) self.options.previous_releases_path = previous_releases_path - config = configparser.ConfigParser() - config.read_file(open(self.options.configfile)) - self.config = config + self.config = configparser.ConfigParser() + self.config.read_file(open(self.options.configfile)) self.binary_paths = self.get_binary_paths() if self.options.v1transport: self.options.v2transport=False @@ -314,10 +313,8 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): self.options.cachedir = os.path.abspath(self.options.cachedir) - config = self.config - os.environ['PATH'] = os.pathsep.join([ - os.path.join(config['environment']['BUILDDIR'], 'bin'), + os.path.join(self.config["environment"]["BUILDDIR"], "bin"), os.environ['PATH'] ])