diff --git a/src/_pytest/runner.py b/src/_pytest/runner.py index 654bd4f22..057317993 100644 --- a/src/_pytest/runner.py +++ b/src/_pytest/runner.py @@ -51,7 +51,8 @@ def pytest_terminal_summary(terminalreporter): for rep in dlist: if verbose < 2 and rep.duration < 0.005: - tr.write_line("0.00 durations hidden. Use -vv to show these durations.") + tr.write_line("") + 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)) diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 9d76415da..59d3c012a 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -818,6 +818,10 @@ class TestDurations(object): result.stdout.fnmatch_lines_random( ["*durations*", "*call*test_3*", "*call*test_2*"] ) + assert "test_something" not in result.stdout.str() + result.stdout.fnmatch_lines( + ["(0.00 durations hidden. Use -vv to show these durations.)"] + ) def test_calls_show_2(self, testdir): testdir.makepyfile(self.source)