aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2021-06-11 14:36:12 +0800
committerfanquake <fanquake@gmail.com>2021-08-18 12:39:18 +0800
commit6679eceacc915a8ea7cd7063f103ffc5eb9da884 (patch)
treea9aab0347cd8ac74d0fec1213f20bf6ae45b9d8c
parentfb633933ab570e945d2a366f37eeff39f516c613 (diff)
downloadbitcoin-6679eceacc915a8ea7cd7063f103ffc5eb9da884.tar.xz
test: use f-strings in feature_logging.py
-rwxr-xr-xtest/functional/feature_logging.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/functional/feature_logging.py b/test/functional/feature_logging.py
index afcbcf099a..722219518a 100755
--- a/test/functional/feature_logging.py
+++ b/test/functional/feature_logging.py
@@ -29,7 +29,7 @@ class LoggingTest(BitcoinTestFramework):
# test alternative log file name outside datadir
tempname = os.path.join(self.options.tmpdir, "foo.log")
- self.restart_node(0, ["-debuglogfile=%s" % tempname])
+ self.restart_node(0, [f"-debuglogfile={tempname}"])
assert os.path.isfile(tempname)
# check that invalid log (relative) will cause error
@@ -37,26 +37,26 @@ class LoggingTest(BitcoinTestFramework):
invalidname = os.path.join("foo", "foo.log")
self.stop_node(0)
exp_stderr = r"Error: Could not open debug log file \S+$"
- self.nodes[0].assert_start_raises_init_error(["-debuglogfile=%s" % (invalidname)], exp_stderr, match=ErrorMatch.FULL_REGEX)
+ self.nodes[0].assert_start_raises_init_error([f"-debuglogfile={invalidname}"], exp_stderr, match=ErrorMatch.FULL_REGEX)
assert not os.path.isfile(os.path.join(invdir, "foo.log"))
# check that invalid log (relative) works after path exists
self.stop_node(0)
os.mkdir(invdir)
- self.start_node(0, ["-debuglogfile=%s" % (invalidname)])
+ self.start_node(0, [f"-debuglogfile={invalidname}"])
assert os.path.isfile(os.path.join(invdir, "foo.log"))
# check that invalid log (absolute) will cause error
self.stop_node(0)
invdir = os.path.join(self.options.tmpdir, "foo")
invalidname = os.path.join(invdir, "foo.log")
- self.nodes[0].assert_start_raises_init_error(["-debuglogfile=%s" % invalidname], exp_stderr, match=ErrorMatch.FULL_REGEX)
+ self.nodes[0].assert_start_raises_init_error([f"-debuglogfile={invalidname}"], exp_stderr, match=ErrorMatch.FULL_REGEX)
assert not os.path.isfile(os.path.join(invdir, "foo.log"))
# check that invalid log (absolute) works after path exists
self.stop_node(0)
os.mkdir(invdir)
- self.start_node(0, ["-debuglogfile=%s" % (invalidname)])
+ self.start_node(0, [f"-debuglogfile={invalidname}"])
assert os.path.isfile(os.path.join(invdir, "foo.log"))
# check that -nodebuglogfile disables logging
@@ -67,7 +67,7 @@ class LoggingTest(BitcoinTestFramework):
assert not os.path.isfile(default_log_path)
# just sanity check no crash here
- self.restart_node(0, ["-debuglogfile=%s" % os.devnull])
+ self.restart_node(0, [f"-debuglogfile={os.devnull}"])
if __name__ == '__main__':