Skip to content
This repository was archived by the owner on Feb 10, 2026. It is now read-only.

Commit e6ae65b

Browse files
committed
test.py: fix .format line KeyError by switching to f"" strings
1 parent 9c98d6b commit e6ae65b

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

tests/__init__.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,20 +125,14 @@ def print_log_tail_on_fail(script_path):
125125
return True
126126
except KeyboardInterrupt:
127127
if not verbose:
128-
print("{line}: {color}INTERRUPT{nocolor}".format(
129-
color=Colors.WARNING,
130-
nocolor=Colors.NO_COLOR)
131-
)
128+
print(f"{line}: {Colors.WARNING}INTERRUPT{Colors.NO_COLOR}")
132129
exit(1)
133130
except Exception: # noqa
134131
if not verbose:
135132
outcome = "XFAIL" if xfail else "FAIL"
136-
print("{line}{fill} {color}{outcome}{nocolor}".format(
137-
fill=(75 - len(line)) * ".",
138-
color=Colors.OKBLUE if xfail else Colors.FAIL,
139-
outcome=outcome,
140-
nocolor=Colors.NO_COLOR)
141-
)
133+
fill = (75 - len(line)) * "."
134+
color = Colors.OKBLUE if xfail else Colors.FAIL
135+
print(f"{line}{fill} {color}{outcome}{Colors.NO_COLOR}")
142136
print_log_tail_on_fail(script_path)
143137
return False
144138

0 commit comments

Comments
 (0)