MCPcopy
hub / github.com/Textualize/rich / test_task_start

Function test_task_start

tests/test_progress.py:420–436  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

418
419
420def test_task_start() -> None:
421 current_time = 1
422
423 def get_time():
424 nonlocal current_time
425 return current_time
426
427 task = Task(TaskID(1), "foo", 100, 0, _get_time=get_time)
428 task.start_time = get_time()
429 assert task.started == True
430 assert task.elapsed == 0
431 current_time += 1
432 assert task.elapsed == 1
433 current_time += 1
434 task.stop_time = get_time()
435 current_time += 1
436 assert task.elapsed == 2
437
438
439def test_task_zero_total() -> None:

Callers

nothing calls this directly

Calls 2

TaskClass · 0.90
get_timeFunction · 0.70

Tested by

no test coverage detected