File tree 3 files changed +13
-3
lines changed
3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -225,6 +225,7 @@ Joseph Hunkeler
225
225
Joseph Sawaya
226
226
Josh Karpel
227
227
Joshua Bronson
228
+ Julian Valentin
228
229
Jurko Gospodnetić
229
230
Justice Ndou
230
231
Justyna Janczyszyn
Original file line number Diff line number Diff line change
1
+ Fixed ``--durations-min `` argument not respected if ``-vv `` is used.
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ def pytest_addoption(parser: Parser) -> None:
61
61
"--durations-min" ,
62
62
action = "store" ,
63
63
type = float ,
64
- default = 0.005 ,
64
+ default = None ,
65
65
metavar = "N" ,
66
66
help = "Minimal duration in seconds for inclusion in slowest list. "
67
67
"Default: 0.005." ,
@@ -74,6 +74,8 @@ def pytest_terminal_summary(terminalreporter: TerminalReporter) -> None:
74
74
verbose = terminalreporter .config .get_verbosity ()
75
75
if durations is None :
76
76
return
77
+ if durations_min is None :
78
+ durations_min = 0.005 if verbose < 2 else 0.0
77
79
tr = terminalreporter
78
80
dlist = []
79
81
for replist in tr .stats .values ():
@@ -90,10 +92,16 @@ def pytest_terminal_summary(terminalreporter: TerminalReporter) -> None:
90
92
dlist = dlist [:durations ]
91
93
92
94
for i , rep in enumerate (dlist ):
93
- if verbose < 2 and rep .duration < durations_min :
95
+ if rep .duration < durations_min :
94
96
tr .write_line ("" )
95
97
tr .write_line (
96
- f"({ len (dlist ) - i } durations < { durations_min :g} s hidden. Use -vv to show these durations.)"
98
+ f"({ len (dlist ) - i } durations < { durations_min :g} s hidden."
99
+ + (
100
+ " Use -vv to show these durations."
101
+ if terminalreporter .config .option .durations_min is None
102
+ else ""
103
+ )
104
+ + ")"
97
105
)
98
106
break
99
107
tr .write_line (f"{ rep .duration :02.2f} s { rep .when :<8} { rep .nodeid } " )
You can’t perform that action at this time.
0 commit comments