Adjust the 'durations hidden' message

This commit is contained in:
Bruno Oliveira 2018-10-13 18:36:20 -03:00
parent 7a271a91b0
commit 3683d92c53
2 changed files with 6 additions and 1 deletions

View File

@ -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))

View File

@ -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)