Skip to content

Commit 8997723

Browse files
logging: Fix linting
1 parent 9999871 commit 8997723

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

tests/task_loop/test_logging.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def main():
173173
tl.log_debug("line 3")
174174

175175
del tl.LogContext.dest_levels["varied"]
176-
tl.LogContext.dest_levels[None] = "warning"
176+
tl.LogContext.dest_levels[None] = "warning" # type:ignore
177177
tl.LogContext.dest_levels[""] = "warning"
178178
tl.log("line 4")
179179

@@ -214,11 +214,7 @@ async def run_task1():
214214
tl.logging.start_logging(file=log_output, destination_label=label)
215215
tl.LogContext.dest_levels["mixed1"] = "info"
216216

217-
tl.LogContext.dest_levels["mixed2"] = {
218-
"root": "debug",
219-
"task1": "info",
220-
"task2": "",
221-
}[task]
217+
tl.LogContext.dest_levels["mixed2"] = "debug" if task == "root" else "info"
222218

223219
task2 = tl.Task(on_run=run_task2)
224220
tl.log("line 2")
@@ -239,11 +235,7 @@ async def run_task2():
239235
tl.logging.start_logging(file=log_output, destination_label=label)
240236
tl.LogContext.dest_levels["mixed1"] = "debug"
241237

242-
tl.LogContext.dest_levels["mixed2"] = {
243-
"root": "error",
244-
"task1": "debug",
245-
"task2": "error",
246-
}[task]
238+
tl.LogContext.dest_levels["mixed2"] = "debug" if task == "task1" else "error"
247239

248240
tl.log_debug("line 3")
249241

0 commit comments

Comments
 (0)