Skip to content

Commit ff7e330

Browse files
committed
test: use f-strings in feature_filelock.py
1 parent d5a6adc commit ff7e330

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/functional/feature_filelock.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ def setup_network(self):
2222

2323
def run_test(self):
2424
datadir = os.path.join(self.nodes[0].datadir, self.chain)
25-
self.log.info("Using datadir {}".format(datadir))
25+
self.log.info(f"Using datadir {datadir}")
2626

2727
self.log.info("Check that we can't start a second bitcoind instance using the same datadir")
28-
expected_msg = "Error: Cannot obtain a lock on data directory {0}. {1} is probably already running.".format(datadir, self.config['environment']['PACKAGE_NAME'])
29-
self.nodes[1].assert_start_raises_init_error(extra_args=['-datadir={}'.format(self.nodes[0].datadir), '-noserver'], expected_msg=expected_msg)
28+
expected_msg = f"Error: Cannot obtain a lock on data directory {datadir}. {self.config['environment']['PACKAGE_NAME']} is probably already running."
29+
self.nodes[1].assert_start_raises_init_error(extra_args=[f'-datadir={self.nodes[0].datadir}', '-noserver'], expected_msg=expected_msg)
3030

3131
if self.is_wallet_compiled():
3232
def check_wallet_filelock(descriptors):
@@ -38,7 +38,7 @@ def check_wallet_filelock(descriptors):
3838
expected_msg = "Error: SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another bitcoind?"
3939
else:
4040
expected_msg = "Error: Error initializing wallet database environment"
41-
self.nodes[1].assert_start_raises_init_error(extra_args=['-walletdir={}'.format(wallet_dir), '-wallet=' + wallet_name, '-noserver'], expected_msg=expected_msg, match=ErrorMatch.PARTIAL_REGEX)
41+
self.nodes[1].assert_start_raises_init_error(extra_args=[f'-walletdir={wallet_dir}', f'-wallet={wallet_name}', '-noserver'], expected_msg=expected_msg, match=ErrorMatch.PARTIAL_REGEX)
4242

4343
if self.is_bdb_compiled():
4444
check_wallet_filelock(False)

0 commit comments

Comments
 (0)