darrenburns / pytest-clarity

A plugin to improve the output of pytest with colourful unified diffs
MIT License
439 stars 23 forks source link

clarity changes verbosity #8

Closed okken closed 4 years ago

okken commented 5 years ago

It's possible that this is on purpose, but it's jarring to me. I have found the plugin most useful when paired with -qq to turn off automatically setting -v or -vv, not sure which.

For example, normally running pytest with no flags results in lots of dots, and with -v you get the test list and pass/fail and percentages. With pytest-clarity, you get all that without the -v. That's fun for a few tests, but annoying with thousands.

darrenburns commented 5 years ago

Thanks for the report Brian! It's intentional, and it was borderline decision on whether to do it or not as it's a bit of a workaround. I totally agree it's jarring in some cases. Either way I should have documented it 😄

When don't supply -v, pytest truncates assertion report output beyond a certain length, and people were finding that this was happening in the majority of cases since the output for this plugin is intentionally verbose. Unfortunately, the only way to stop this truncation (AFAIK) is to supply the -v flag to pytest, which has the unintended side-effect of also make the test runner output more verbose.

I don't think pytest configuration is fine-grained enough to keep the succinct test runner output (the dots), and non-truncated assertion reporting output.

danihodovic commented 4 years ago

@darrenburns is it possible to disable the output for passing tests and just use the normal dot output?

ionelmc commented 4 years ago

A solution could be to activate the plugin only if verbose mode is on (user adds -vv).

darrenburns commented 4 years ago

I've released a new version which only activates the plugin if -vv is used. It also fixed the incompatibility with xdist. Thanks @ionelmc!

danihodovic commented 4 years ago

@darrenburns thanks!!