Skip to content

Commit

Permalink
Simplify message formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianJvn committed Jan 2, 2025
1 parent 61b4f7a commit a811765
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/_pytest/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,11 @@ def pytest_terminal_summary(terminalreporter: TerminalReporter) -> None:
for i, rep in enumerate(dlist):
if rep.duration < durations_min:
tr.write_line("")
tr.write_line(
f"({len(dlist) - i} durations < {durations_min:g}s hidden."
+ (
" Use -vv to show these durations."
if terminalreporter.config.option.durations_min is None
else ""
)
+ ")"
)
message = f"({len(dlist) - i} durations < {durations_min:g}s hidden."

Check warning on line 97 in src/_pytest/runner.py

View check run for this annotation

Codecov / codecov/patch

src/_pytest/runner.py#L97

Added line #L97 was not covered by tests
if terminalreporter.config.option.durations_min is None:
message += " Use -vv to show these durations."
message += ")"
tr.write_line(message)

Check warning on line 101 in src/_pytest/runner.py

View check run for this annotation

Codecov / codecov/patch

src/_pytest/runner.py#L99-L101

Added lines #L99 - L101 were not covered by tests
break
tr.write_line(f"{rep.duration:02.2f}s {rep.when:<8} {rep.nodeid}")

Expand Down

0 comments on commit a811765

Please sign in to comment.