-
Notifications
You must be signed in to change notification settings - Fork 37.7k
test: refactor: introduce replace_in_config
helper
#26956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: refactor: introduce replace_in_config
helper
#26956
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable. Maybe you could also use the helper here:
bitcoin/test/functional/test_framework/test_framework.py
Lines 536 to 540 in 5271c77
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]', '')) |
7eb1a9d
to
d14740f
Compare
Good catch, thanks! Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK d14740f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crACK d14740f
d14740f
to
6da0096
Compare
6da0096
to
b530d96
Compare
Force-pushed with a version that introduces the helper now as |
ACK b530d96 |
Currently two functional tests (p2p_permissions.py and wallet_crosschain.py) include quite similar code for substituting strings in a TestNode's bitcoind configuration file, so refactoring that out to a dedicated helper method seems to make sense (probably other tests could need that too in the future).