Add confval console_output_style option times#13126
Add confval console_output_style option times#13126nicoddemus merged 17 commits intopytest-dev:mainfrom
console_output_style option times#13126Conversation
|
@afcmrp can you add a sample output using the new option to the PR description? |
@nicoddemus Yes of course. Non-verbose: Verbose: |
|
I like the output, thanks! I will review the code ASAP. |
There was a problem hiding this comment.
Overall this all looks great!
Playing around with it with xdist:
[gw0]101.1ms PASSED .tmp/test_bar.py::test_bar[0]
.tmp/test_bar.py::test_bar[1]
[gw0]541.1ms PASSED .tmp/test_bar.py::test_bar[1]
.tmp/test_bar.py::test_bar[6]
[gw2]179.7us PASSED .tmp/test_bar.py::test_bar[4]
.tmp/test_bar.py::test_bar[5]
[gw1]188.4us PASSED .tmp/test_bar.py::test_bar[2]
And without the option:
[gw2] [ 6%] PASSED .tmp/test_bar.py::test_bar[4]
.tmp/test_bar.py::test_bar[5]
[gw0] [ 12%] PASSED .tmp/test_bar.py::test_bar[0]
.tmp/test_bar.py::test_bar[1]
[gw2] [ 18%] PASSED .tmp/test_bar.py::test_bar[5]
.tmp/test_bar.py::test_bar[6]
[gw1] [ 25%] PASSED .tmp/test_bar.py::test_bar[2]
The timing is "glued" to the gateway name ([gw0]101.1ms PASSED), I think it would look better if it was separated by a space ([gw0] 101.1ms PASSED).
Can you fix that and add a test for it?
|
Some final bikeshedding: perhaps the option should be |
Yes, agreed. Of those two I prefer |
To me |
Co-authored-by: Bruno Oliveira <bruno@soliv.dev>
console_output_style option timerconsole_output_style option times
nicoddemus
left a comment
There was a problem hiding this comment.
Awesome, thanks, excellent contribution!
I will leave this open for a few more days to give others a chance to chime in.
Adds an additional confval
timestoconsole_output_style.Design decisions
Duration format
The duration format should be as short, detailed and human readable as possible. It also needs to predictable in terms of character length to know how much space to allocate to the right in the console output.
I landed on this:
30m 59s10.124s9.124s123.6ms12.36msThis maintains relatively high resolution for all duration lengths, keeps the string maximum 7 characters long (for durations below 100 hours) and is pleasant to look at.
Verbose vs non-verbose
For the non-verbose case I decided to sum up the durations for all tests per file to keep things as consistent with the other
console_output_style's as possible. Additionally, teardown is currently only counted for the non-verbose case.Example output
Non-verbose
Verbose
Closes #13125