-
Notifications
You must be signed in to change notification settings - Fork 214
Makes coverage disabled message a debugging one #304
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
Conversation
Avoids poluting stdout with a warning message which is unlikely to be caused by an accident (adding --no-cov switch) Fixes: pytest-dev#284
It still adds the warning though - i.e. what is the point of logging + warning? |
Maybe we should remove the |
I think we should still have something. The idea is that the warning is there so people don't end up having |
@ionelmc I guess we are in different teams here as I am trying to get rid of this spammy message. I guess this warnings was added to protect python-cov project maintainers from being spammed by false bug reports. It probably works, at the detriments of the users that are genuinely disabling coverage. I may be biased here and but I really do not think we can really protect outselves from all things that could go wrong with the tool usage. I would rather change the new bug template to mentionn this issue and disable the warning. |
I guess I don't understand the issue that needs to be fixed. I can understand removing the warning (it changes the test result warning count). But what's the terminal output removal for? What problem does it fix? |
Let me try to explain, on my desktop I do have this in my user profile:
That counts as local developer settings applying to >100 projects I am using or contributing too, with clear resons for each: not interested in coverage as it creates lost of extra lines in console and I am forced to do extra scrolls to see stuff that mattered more (like a test failure), disabling std capture. I added these parameters deliverately in order to be able to call pytest the way I want during development. It was was my decision to do so. Even better most projects using tox also respect that by passing PYTEST_OPTS, so I can do I know that you could argue that if you don't want coverage don't install the plugin, or even disable it. The bit issue is that this is impossible without altering the source code. That is because if I disable or uninstall it I will get 4/5 chances of not being able to run because: either the developer added some converage specific options to pytest.ini or to the call from inside tox.ini. This means that you still need the plugin installed in order to avoid the failure. So now we are back to the question: How do I skip running coverage without poluting the console output? I am not trying to say that this PR is the only way to address that issue, but I hope I explained the issue well enough so we can find a way to avoid that noise. This plugin should just respect the Example
|
Just for information:
You can use You say that this would then cause error when pytest-cov options are used, but on the other hand you should see errors already when pytest-cov is not installed (since |
Oook so how about we remove the warning since that takes the most lines and keep the print (the terminalwriter stuff)? Fair compromise yes? |
Of for me but with the remark that the print ling should not start with "WARNING". I do have some filters in the terminal which colorize it as a real warning. Some CI systems do parse stdout/stderr and grab all warnings based on regex, so I think it should be better be a "NOTICE:"? Once liner would a good compromise in that case. |
It was |
Ok so I've changed it to a notice and fixed the test. Everyone happy? |
@ssbarnea well, does this fix your CI problem? |
So this was fixed differently (referenced commits), let me know if it ain't enough. |
I can't seem to find the commit that fixes this that actually made it into master |
Avoids poluting stdout with a warning message which is unlikely to be
caused by an accident (adding --no-cov switch)
Fixes: #284