Skip to content

Commit

Permalink
Improved terminal message when the --duration option is used so as …
Browse files Browse the repository at this point in the history
…to display the number of skipped items with small duration < 0.005s. Fixed pytest-dev#6940
  • Loading branch information
Sylvain MARIE committed Mar 19, 2020
1 parent 55d484c commit 8c041d3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/_pytest/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ def pytest_terminal_summary(terminalreporter):
tr.write_sep("=", "slowest %s test durations" % durations)
dlist = dlist[:durations]

for rep in dlist:
for i, rep in enumerate(dlist):
if verbose < 2 and rep.duration < 0.005:
tr.write_line("")
tr.write_line("(0.00 durations hidden. Use -vv to show these durations.)")
tr.write_line("(%s items with duration < 0.005s hidden. Use -vv to show these durations.)"
% (len(dlist) - i))
break
tr.write_line("{:02.2f}s {:<8} {}".format(rep.duration, rep.when, rep.nodeid))

Expand Down

0 comments on commit 8c041d3

Please sign in to comment.