You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
68faa87 test: use f-strings in mining_*.py tests (fanquake)
c2a5d56 test: use f-strings in interface_*.py tests (fanquake)
86d9582 test: use f-strings in feature_proxy.py (fanquake)
31bdb33 test: use f-strings in feature_segwit.py (fanquake)
b166d54 test: use f-strings in feature_versionbits_warning.py (fanquake)
cf6d66b test: use f-strings in feature_settings.py (fanquake)
6651d77 test: use f-strings in feature_pruning.py (fanquake)
961f581 test: use f-strings in feature_notifications.py (fanquake)
1a546e6 test: use f-strings in feature_minchainwork.py (fanquake)
6679ece test: use f-strings in feature_logging.py (fanquake)
fb63393 test: use f-strings in feature_loadblock.py (fanquake)
e9ca8b2 test: use f-strings in feature_help.py (fanquake)
ff7e330 test: use f-strings in feature_filelock.py (fanquake)
d5a6adc test: use f-strings in feature_fee_estimation.py (fanquake)
a2de33c test: use f-strings in feature_dersig.py (fanquake)
a2502cc test: use f-strings in feature_dbcrash.py (fanquake)
3e2f84e test: use f-strings in feature_csv_activation.py (fanquake)
e2f1fd8 test: use f-strings in feature_config_args.py (fanquake)
36d33d3 test: use f-strings in feature_cltv.py (fanquake)
dca173c test: use f-strings in feature_blocksdir.py (fanquake)
5453e87 test: use f-strings in feature_backwards_compatibility.py (fanquake)
6f3d5ad test: use f-strings in feature_asmap.py (fanquake)
Pull request description:
Rather than using 3 different ways to build/format strings (sometimes all in the same test, i.e [`feature_config_args.py`](https://github.com/bitcoin/bitcoin/blob/master/test/functional/feature_config_args.py)), consolidate to using [f-strings (3.6+)](https://docs.python.org/3/reference/lexical_analysis.html#f-strings), which are generally more concise / readable, as well as more performant than existing methods.
This deals with the `feature_*.py`, `interface_*.py` and `mining_*.py` tests.
See also: [PEP 498](https://www.python.org/dev/peps/pep-0498/)
ACKs for top commit:
mjdietzx:
reACK 68faa87
Zero-1729:
crACK 68faa87
Tree-SHA512: d4e1a42e07d96d2c552387a46da1534223c4ce408703d7568ad2ef580797dd68d9695b8d19666b567af37f44de6e430e8be5db5d5404ba8fcecf9f5b026a6efb
self.nodes[0].assert_start_raises_init_error(["-blocksdir="+blocksdir_path], 'Error: Specified blocks directory "{}" does not exist.'.format(blocksdir_path))
27
+
self.nodes[0].assert_start_raises_init_error([f"-blocksdir={blocksdir_path}"], f'Error: Specified blocks directory "{blocksdir_path}" does not exist.')
28
28
os.mkdir(blocksdir_path)
29
29
self.log.info("Starting with existing blocksdir ...")
self.nodes[0].assert_start_raises_init_error(expected_msg='Error: Config setting for -wallet only applied on %s network when in [%s] section.'% (self.chain, self.chain))
46
+
self.nodes[0].assert_start_raises_init_error(expected_msg=f'Error: Config setting for -wallet only applied on {self.chain} network when in [{self.chain}] section.')
self.nodes[0].assert_start_raises_init_error(extra_args=["-conf={}".format(main_conf_file_path)], expected_msg='Error: acceptnonstdtxn is not currently supported for main chain')
52
+
self.nodes[0].assert_start_raises_init_error(extra_args=[f"-conf={main_conf_file_path}"], expected_msg='Error: acceptnonstdtxn is not currently supported for main chain')
self.nodes[0].stop_node(expected_stderr='Warning: '+inc_conf_file_path+':1 Section [testnot] is not recognized.'+os.linesep+inc_conf_file2_path+':1 Section [testnet] is not recognized.')
79
+
self.nodes[0].stop_node(expected_stderr=f'Warning: {inc_conf_file_path}:1 Section [testnot] is not recognized.{os.linesep}{inc_conf_file2_path}:1 Section [testnet] is not recognized.')
self.nodes[0].assert_start_raises_init_error(['-conf='+conf_file], 'Error: Error reading configuration file: specified data directory "'+new_data_dir+'" does not exist.')
249
+
self.nodes[0].assert_start_raises_init_error([f'-conf={conf_file}'], f'Error: Error reading configuration file: specified data directory "{new_data_dir}" does not exist.')
250
250
251
251
# Create the directory and ensure the config file now works
self.log.info("Height = {}, CSV not yet active (will activate for block {}, not {})".format(self.tipheight, CSV_ACTIVATION_HEIGHT, CSV_ACTIVATION_HEIGHT-1))
250
+
self.log.info(f"Height = {self.tipheight}, CSV not yet active (will activate for block {CSV_ACTIVATION_HEIGHT}, not {CSV_ACTIVATION_HEIGHT-1})")
251
251
assertnotsoftfork_active(self.nodes[0], 'csv')
252
252
253
253
# Test both version 1 and version 2 transactions for all tests
0 commit comments