Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unify cli verbosity handling #3296

Merged
merged 1 commit into from
Mar 13, 2018

Conversation

RonnyPfannschmidt
Copy link
Member

based on #3294 (comment)

we really shouldnt have N options we post mortem hack together to determine verbosity
this change starts by unifying the data, we still need to handle deprecation/removal of config.quiet

@RonnyPfannschmidt RonnyPfannschmidt force-pushed the verbosity-actions branch 2 times, most recently from d7b9744 to c1b14cf Compare March 12, 2018 10:58
@twmr
Copy link
Contributor

twmr commented Mar 12, 2018

Thank you very much for working on this!!

@RonnyPfannschmidt RonnyPfannschmidt force-pushed the verbosity-actions branch 2 times, most recently from f1a8174 to 1dccfa4 Compare March 12, 2018 12:56
@coveralls
Copy link

coveralls commented Mar 12, 2018

Coverage Status

Coverage increased (+0.06%) to 92.971% when pulling 37a5260 on RonnyPfannschmidt:verbosity-actions into f8791c9 on pytest-dev:features.

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from my minor comments, we also need to add tests.

new_count = getattr(namespace, self.dest, 0) - 1
setattr(namespace, self.dest, new_count)
# todo Deprecate config.quiet
namespace.quiet = getattr(namespace, 'quiet', 0) + 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm do we really need to deprecate namespace.quiet? If all we need to do is to keep this line around, I wouldn't bother TBH.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its random shitty data showing up in introspection

on top of that its half-dead zombie data and partially incorrect, it should go away

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't we remove it now? Is it because it might be used by thirdparty plugins?

import argparse


class MoreQuietAction(argparse.Action):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a docstring documenting why this class exists.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why we need this class. What does it fix?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it implements a negative counter and backward compat hacking, it can be simplified later on but its necessary since argparse itself is kinda shitty ^^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah. It is needed to get rid of config.option.verbose -= config.option.quiet, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup

@@ -0,0 +1 @@
unify cli verbosity handling
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would write something that makes sense to users:

Refactoring to unify how verbosity is handled internally.

And we also need a new feature entry:

New ``--verbosity`` flag to set verbosity level explicitly.

based on pytest-dev#3294 (comment)

we really shouldnt have N options we post mortem hack together to determine verbosity
this change starts by unifying the data, we still need to handle deprecation/removal of config.quiet
@nicoddemus nicoddemus merged commit 4175ed8 into pytest-dev:features Mar 13, 2018
@RonnyPfannschmidt RonnyPfannschmidt deleted the verbosity-actions branch October 1, 2018 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants