Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add confval console_output_style option times #13126

Merged
merged 17 commits into from
Jan 20, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Lint fixes
afcmrp committed Jan 11, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 8169b6d63a30cb50e616647c30df1d95f33148c1
16 changes: 8 additions & 8 deletions src/_pytest/terminal.py
Original file line number Diff line number Diff line change
@@ -1592,22 +1592,22 @@ def format_node_duration(seconds: float) -> str:
# The formatting is designed to be compact and readable, with at most 7 characters
# for durations below 100 hours.
if seconds < 0.00001:
return f"{seconds*1000000:.3f}us"
return f"{seconds * 1000000:.3f}us"
if seconds < 0.0001:
return f"{seconds*1000000:.2f}us"
return f"{seconds * 1000000:.2f}us"
if seconds < 0.001:
return f"{seconds*1000000:.1f}us"
return f"{seconds * 1000000:.1f}us"
if seconds < 0.01:
return f"{seconds*1000:.3f}ms"
return f"{seconds * 1000:.3f}ms"
if seconds < 0.1:
return f"{seconds*1000:.2f}ms"
return f"{seconds * 1000:.2f}ms"
if seconds < 1:
return f"{seconds*1000:.1f}ms"
return f"{seconds * 1000:.1f}ms"
if seconds < 60:
return f"{seconds:.3f}s"
if seconds < 3600:
return f"{seconds//60:.0f}m {seconds%60:.0f}s"
return f"{seconds//3600:.0f}h {(seconds%3600)//60:.0f}m"
return f"{seconds // 60:.0f}m {seconds % 60:.0f}s"
return f"{seconds // 3600:.0f}h {(seconds % 3600) // 60:.0f}m"


def _get_raw_skip_reason(report: TestReport) -> str: