question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Separate terminal verbosity from diff verbosity

See original GitHub issue

Currently -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.

Related: #6292, #5192

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:6
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
strokirkcommented, Feb 16, 2020

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.

1reaction
nicoddemuscommented, Jun 14, 2021

@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.

I’m a bit strapped for time, however, and I’m not very experienced with the codebase so will likely need guidance.

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. 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found