Skip to content

Commit 6679ece

Browse files
committed
test: use f-strings in feature_logging.py
1 parent fb63393 commit 6679ece

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/functional/feature_logging.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,34 +29,34 @@ def run_test(self):
2929

3030
# test alternative log file name outside datadir
3131
tempname = os.path.join(self.options.tmpdir, "foo.log")
32-
self.restart_node(0, ["-debuglogfile=%s" % tempname])
32+
self.restart_node(0, [f"-debuglogfile={tempname}"])
3333
assert os.path.isfile(tempname)
3434

3535
# check that invalid log (relative) will cause error
3636
invdir = self.relative_log_path("foo")
3737
invalidname = os.path.join("foo", "foo.log")
3838
self.stop_node(0)
3939
exp_stderr = r"Error: Could not open debug log file \S+$"
40-
self.nodes[0].assert_start_raises_init_error(["-debuglogfile=%s" % (invalidname)], exp_stderr, match=ErrorMatch.FULL_REGEX)
40+
self.nodes[0].assert_start_raises_init_error([f"-debuglogfile={invalidname}"], exp_stderr, match=ErrorMatch.FULL_REGEX)
4141
assert not os.path.isfile(os.path.join(invdir, "foo.log"))
4242

4343
# check that invalid log (relative) works after path exists
4444
self.stop_node(0)
4545
os.mkdir(invdir)
46-
self.start_node(0, ["-debuglogfile=%s" % (invalidname)])
46+
self.start_node(0, [f"-debuglogfile={invalidname}"])
4747
assert os.path.isfile(os.path.join(invdir, "foo.log"))
4848

4949
# check that invalid log (absolute) will cause error
5050
self.stop_node(0)
5151
invdir = os.path.join(self.options.tmpdir, "foo")
5252
invalidname = os.path.join(invdir, "foo.log")
53-
self.nodes[0].assert_start_raises_init_error(["-debuglogfile=%s" % invalidname], exp_stderr, match=ErrorMatch.FULL_REGEX)
53+
self.nodes[0].assert_start_raises_init_error([f"-debuglogfile={invalidname}"], exp_stderr, match=ErrorMatch.FULL_REGEX)
5454
assert not os.path.isfile(os.path.join(invdir, "foo.log"))
5555

5656
# check that invalid log (absolute) works after path exists
5757
self.stop_node(0)
5858
os.mkdir(invdir)
59-
self.start_node(0, ["-debuglogfile=%s" % (invalidname)])
59+
self.start_node(0, [f"-debuglogfile={invalidname}"])
6060
assert os.path.isfile(os.path.join(invdir, "foo.log"))
6161

6262
# check that -nodebuglogfile disables logging
@@ -67,7 +67,7 @@ def run_test(self):
6767
assert not os.path.isfile(default_log_path)
6868

6969
# just sanity check no crash here
70-
self.restart_node(0, ["-debuglogfile=%s" % os.devnull])
70+
self.restart_node(0, [f"-debuglogfile={os.devnull}"])
7171

7272

7373
if __name__ == '__main__':

0 commit comments

Comments
 (0)