From b530d9605db863fd8d0e45e73ff2eb9462d1ad4c Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Mon, 23 Jan 2023 17:35:04 +0100 Subject: test: refactor: introduce `replace_in_config` helper --- test/functional/test_framework/test_framework.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'test/functional/test_framework/test_framework.py') 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""" -- cgit v1.2.3