MCPcopy Create free account
hub / github.com/pytest-dev/pytest / format_session_duration

Function format_session_duration

src/_pytest/terminal.py:1367–1373  ·  view source on GitHub ↗

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

1365
1366
1367def format_session_duration(seconds: float) -> str:
1368 """Format the given seconds in a human readable manner to show in the final summary."""
1369 if seconds < 60:
1370 return f"{seconds:.2f}s"
1371 else:
1372 dt = datetime.timedelta(seconds=int(seconds))
1373 return f"{seconds:.2f}s ({dt})"
1374
1375
1376def _get_raw_skip_reason(report: TestReport) -> str:

Callers 2

summary_statsMethod · 0.85

Calls 1

intClass · 0.85

Tested by 1