mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-09-12 07:25:07 +02:00
test: Remove duplicate ConfigParser
It is sufficient to parse once.
This commit is contained in:
@@ -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="
|
||||
|
@@ -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']
|
||||
])
|
||||
|
||||
|
Reference in New Issue
Block a user