Update messaging for --durations when not in verbose mode.

This commit is contained in:
Jeffrey Rackauckas 2018-10-13 12:51:04 -07:00
parent fc11b81005
commit 47f5c29002
3 changed files with 3 additions and 1 deletions

View File

@ -1 +1 @@
Exclude 0.00 second entries from ``--duration`` output.
Exclude 0.00 second entries from ``--duration`` output unless ``-vv`` is passed on the command-line.

View File

@ -269,6 +269,7 @@ To get a list of the slowest 10 test durations::
pytest --durations=10
By default, pytest will not show test durations that are too small (<0.01s) unless ``-vv`` is passed on the command-line.
Creating JUnitXML format files
----------------------------------------------------

View File

@ -51,6 +51,7 @@ def pytest_terminal_summary(terminalreporter):
for rep in dlist:
if verbose < 2 and rep.duration < 0.01:
tr.write_line("0.00 durations hidden. Use -vv to show these durations.")
break
nodeid = rep.nodeid.replace("::()::", "::")
tr.write_line("%02.2fs %-8s %s" % (rep.duration, rep.when, nodeid))