Separate terminal verbosity from diff verbosity
See original GitHub issueCurrently -v
controls both terminal verbosity (how to display test session progress in the terminal) and diff verbosity (how verbose is our diffs when assertions fail).
I’ve often wanted to increase diff verbosity while also keeping terminal verbosity at the normal level, but this is not possible today.
Proposal
Introduce a new option that controls only diff verbosity (for discussion here -dv
, but please let’s bikeshed on this).
For backward compatibility reasons, -v
keeps controlling both terminal verbosity and diff verbosity, but -dv
can be used to increase diff verbosity independently.
-v
: when used, increase both terminal verbosity and diff verbosity.-dv
: when used, increase diff verbosity only (we also need the equivalent of-q
for diff verbosity).
With -dv
in place, we might even consider changing to a higher level of diff verbosity in the future by default, but that remains to be seen.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Verbosity vs. Quietness in CLI - Educative.io
In sum, verbosity makes the command-line interface (CLI) tool display more detailed information than usual. Quietness is the opposite, in which CLI displays ......
Read more >Different levels of help verbosity in argparse - Stack Overflow
My first idea was to create two ArgumentParser-s, the basic one and the verbose one. First, parse_args of the basic was called. If...
Read more >Verbosity Levels (Symfony Docs)
Console commands have different verbosity levels, which determine the messages displayed in their output. By default, commands display only the most useful ...
Read more >Why the -v for the verbose mode on commands makes it slower?
I was executing a script and by measuring the time that he made, i've found that using the -v on some mv commands...
Read more >CLI verbosity levels - CLI Guidelines - Ubuntu Community Hub
When working with a CLI users from different backgrounds who operate different tasks might want to see information with different verbosity ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Adding this as a config option (rather than a CLI-flag) as a first step would work well for me, since I almost always want the highest level of verbosity for tests.
@iliakur thanks for volunteering! Yes definitely there’s still interest in this.
Beside the original post, we also need to consider the remarks in https://github.com/pytest-dev/pytest/issues/6723#issuecomment-585688033.
Sure, we are glad to provide it. To get you started, you can see that
-v
is declared here:https://github.com/pytest-dev/pytest/blob/ced125ad153bb3e24710ad478b8986147f9b1a5d/src/_pytest/terminal.py#L114-L123
And is used like this throughout the codebase:
https://github.com/pytest-dev/pytest/blob/ced125ad153bb3e24710ad478b8986147f9b1a5d/src/_pytest/terminal.py#L773-L775
So we need to review everywhere the option is used and adapt it for the new flags (which we still need to decide precisely).
Let us know if this is enough to at least get started. 👍