MCPcopy
hub / github.com/pytest-dev/pytest / format_session_duration

Function format_session_duration

src/_pytest/terminal.py:1647–1653  ·  src/_pytest/terminal.py::format_session_duration

Format the given seconds in a human readable manner to show in the final summary.

(seconds: float)

Source from the content-addressed store, hash-verified

1645
1646
1647def format_session_duration(seconds: float) -> str:
1648 class="st">""class="st">"Format the given seconds in a human readable manner to show in the final summary."class="st">""
1649 if seconds < 60:
1650 return fclass="st">"{seconds:.2f}s"
1651 else:
1652 dt = datetime.timedelta(seconds=int(seconds))
1653 return fclass="st">"{seconds:.2f}s ({dt})"
1654
1655
1656def format_node_duration(seconds: float) -> str:

Callers 2

summary_statsMethod · 0.85

Calls 1

intClass · 0.85

Tested by 1