Skip to content

Commit

Permalink
test: use f-strings in feature_filelock.py
Browse files Browse the repository at this point in the history
  • Loading branch information
fanquake committed Aug 18, 2021
1 parent d5a6adc commit ff7e330
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/functional/feature_filelock.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ def setup_network(self):

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

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

if self.is_wallet_compiled():
def check_wallet_filelock(descriptors):
Expand All @@ -38,7 +38,7 @@ def check_wallet_filelock(descriptors):
expected_msg = "Error: SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another bitcoind?"
else:
expected_msg = "Error: Error initializing wallet database environment"
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)
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)

if self.is_bdb_compiled():
check_wallet_filelock(False)
Expand Down

0 comments on commit ff7e330

Please sign in to comment.