diff --git a/changelog/4063.trivial.rst b/changelog/4063.trivial.rst index 3e0aaf0f0..465356401 100644 --- a/changelog/4063.trivial.rst +++ b/changelog/4063.trivial.rst @@ -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. diff --git a/doc/en/usage.rst b/doc/en/usage.rst index e5521bba5..cc118fad8 100644 --- a/doc/en/usage.rst +++ b/doc/en/usage.rst @@ -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 ---------------------------------------------------- diff --git a/src/_pytest/runner.py b/src/_pytest/runner.py index 8f1a710f9..f01b06314 100644 --- a/src/_pytest/runner.py +++ b/src/_pytest/runner.py @@ -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))