You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like pytest to give the full output on test failures for debugging purposes (by specifying -vv) while still being able to print the durations of tests and fixtures that exceed a given threshold (by using --durations-min).
It's not documented neither in pytest --help nor in the documentation that --durations-min has no effect if -vv is specified. I had to look at pytest's code to learn this:
The documentation only says the default behavior is equivalent to --durations-min 0.005 to when -vv is not specified. It does not say custom --durations-min values have no effect if -vv is specified. So, if this issue is not implemented, it is at least a documentation bug.
It's asymmetric/inconsistent that --durations still has effect if -vv specified, but --durations-min does not.
It's unexpected that a more specific option like --durations-min is overridden by a less specific option like --verbose.
The options currently work like this, depending if they're specified (Y) or not (N) or if it doesn't matter whether they're specified or not (*):
--durations=N
--durations-min=X
-vv
Behavior
N
*
*
No durations are displayed
Y
N
N
Top N durations with duration ≥ 0.005s are displayed
Y
Y
N
Top N durations with duration ≥ X are displayed
Y
*
Y
Top N durations are displayed
Describe the solution you'd like
If --durations-min is explicitly specified, it should have precedence over -vv. The options could work like this:
--durations=N
--durations-min=X
-vv
Behavior
N
*
*
No durations are displayed
Y
N
N
Top N durations with duration ≥ 0.005s are displayed
Y
N
Y
Top N durations are displayed
Y
Y
*
Top N durations with duration ≥ X are displayed
Alternative Solutions
Another possibility that would work for me is removing the feature that -vv changes the default value of --durations-min, i.e., the options would be decoupled. The previous behavior could be easily restored with --durations-min=0. The options would then work like this:
--durations=N
--durations-min=X
-vv
Behavior
N
*
*
No durations are displayed
Y
N
*
Top N durations with duration ≥ 0.005s are displayed
Y
Y
*
Top N durations with duration ≥ X are displayed
Additional context
—
The text was updated successfully, but these errors were encountered:
What's the problem this feature will solve?
I'd like pytest to give the full output on test failures for debugging purposes (by specifying
-vv
) while still being able to print the durations of tests and fixtures that exceed a given threshold (by using--durations-min
).pytest --help
nor in the documentation that--durations-min
has no effect if-vv
is specified. I had to look at pytest's code to learn this:pytest/src/_pytest/runner.py
Line 93 in 3ef3c2d
--durations-min 0.005
to when-vv
is not specified. It does not say custom--durations-min
values have no effect if-vv
is specified. So, if this issue is not implemented, it is at least a documentation bug.--durations
still has effect if-vv
specified, but--durations-min
does not.--durations-min
is overridden by a less specific option like--verbose
.The options currently work like this, depending if they're specified (Y) or not (N) or if it doesn't matter whether they're specified or not (*):
--durations=N
--durations-min=X
-vv
Describe the solution you'd like
If
--durations-min
is explicitly specified, it should have precedence over-vv
. The options could work like this:--durations=N
--durations-min=X
-vv
Alternative Solutions
Another possibility that would work for me is removing the feature that
-vv
changes the default value of--durations-min
, i.e., the options would be decoupled. The previous behavior could be easily restored with--durations-min=0
. The options would then work like this:--durations=N
--durations-min=X
-vv
Additional context
—
The text was updated successfully, but these errors were encountered: