runner: combine a sort+reverse to a sort(reverse=True)

Suggested by Zac-HD.
This commit is contained in:
Ran Benita 2020-10-19 00:00:22 +03:00
parent 1b23a111d2
commit 09e38b1697
1 changed files with 1 additions and 2 deletions

View File

@ -77,8 +77,7 @@ def pytest_terminal_summary(terminalreporter: "TerminalReporter") -> None:
dlist.append(rep) dlist.append(rep)
if not dlist: if not dlist:
return return
dlist.sort(key=lambda x: x.duration) # type: ignore[no-any-return] dlist.sort(key=lambda x: x.duration, reverse=True) # type: ignore[no-any-return]
dlist.reverse()
if not durations: if not durations:
tr.write_sep("=", "slowest durations") tr.write_sep("=", "slowest durations")
else: else: