From 3683d92c530472cab40d74d9e8c951b33f9ef411 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 13 Oct 2018 18:36:20 -0300 Subject: [PATCH] Adjust the 'durations hidden' message --- src/_pytest/runner.py | 3 ++- testing/acceptance_test.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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)