@@ -29,34 +29,34 @@ def run_test(self):
29
29
30
30
# test alternative log file name outside datadir
31
31
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 } " ])
33
33
assert os .path .isfile (tempname )
34
34
35
35
# check that invalid log (relative) will cause error
36
36
invdir = self .relative_log_path ("foo" )
37
37
invalidname = os .path .join ("foo" , "foo.log" )
38
38
self .stop_node (0 )
39
39
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 )
41
41
assert not os .path .isfile (os .path .join (invdir , "foo.log" ))
42
42
43
43
# check that invalid log (relative) works after path exists
44
44
self .stop_node (0 )
45
45
os .mkdir (invdir )
46
- self .start_node (0 , ["-debuglogfile=%s" % ( invalidname ) ])
46
+ self .start_node (0 , [f "-debuglogfile={ invalidname } " ])
47
47
assert os .path .isfile (os .path .join (invdir , "foo.log" ))
48
48
49
49
# check that invalid log (absolute) will cause error
50
50
self .stop_node (0 )
51
51
invdir = os .path .join (self .options .tmpdir , "foo" )
52
52
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 )
54
54
assert not os .path .isfile (os .path .join (invdir , "foo.log" ))
55
55
56
56
# check that invalid log (absolute) works after path exists
57
57
self .stop_node (0 )
58
58
os .mkdir (invdir )
59
- self .start_node (0 , ["-debuglogfile=%s" % ( invalidname ) ])
59
+ self .start_node (0 , [f "-debuglogfile={ invalidname } " ])
60
60
assert os .path .isfile (os .path .join (invdir , "foo.log" ))
61
61
62
62
# check that -nodebuglogfile disables logging
@@ -67,7 +67,7 @@ def run_test(self):
67
67
assert not os .path .isfile (default_log_path )
68
68
69
69
# just sanity check no crash here
70
- self .restart_node (0 , ["-debuglogfile=%s" % os .devnull ])
70
+ self .restart_node (0 , [f "-debuglogfile={ os .devnull } " ])
71
71
72
72
73
73
if __name__ == '__main__' :
0 commit comments