aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/test_framework.py
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2023-01-23 17:35:04 +0100
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2023-01-28 23:49:55 +0100
commitb530d9605db863fd8d0e45e73ff2eb9462d1ad4c (patch)
treeda1393f93c278b292e68e65ec1d35e724dc2f726 /test/functional/test_framework/test_framework.py
parent5271c77f8356dc6de95fd6d08a415df3568eb7a1 (diff)
downloadbitcoin-b530d9605db863fd8d0e45e73ff2eb9462d1ad4c.tar.xz
test: refactor: introduce `replace_in_config` helper
Diffstat (limited to 'test/functional/test_framework/test_framework.py')
-rwxr-xr-xtest/functional/test_framework/test_framework.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py
index 823958397d..6ff4e4ee54 100755
--- a/test/functional/test_framework/test_framework.py
+++ b/test/functional/test_framework/test_framework.py
@@ -533,11 +533,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
self.nodes.append(test_node_i)
if not test_node_i.version_is_at_least(170000):
# adjust conf for pre 17
- conf_file = test_node_i.bitcoinconf
- with open(conf_file, 'r', encoding='utf8') as conf:
- conf_data = conf.read()
- with open(conf_file, 'w', encoding='utf8') as conf:
- conf.write(conf_data.replace('[regtest]', ''))
+ test_node_i.replace_in_config([('[regtest]', '')])
def start_node(self, i, *args, **kwargs):
"""Start a bitcoind"""