-
Notifications
You must be signed in to change notification settings - Fork 18
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
Catching logs of pytest-flake8 plugin #59
Comments
In case someone is looking for a workaround, there is one. You can disable the 'flake8' logger for the entire session by putting an from logging import getLogger
getLogger('flake8').propagate = False |
Actually I also think that this logger should be disabled by default. It's starting to be headache when dealing with not only checking 'tests', where you can put
|
|
I think maybe a more appropriate default logging setting for flake8 would perhaps be 'WARNING'? |
You can simply add a
|
When using the pytest-flake8 plugin the flake logs get catched by pytest-catchlog, making it difficult to see the actual flake error output:
`======== FAILURES ========
_______ FLAKE8-check _______
/home/user/Projects/test/test.py:12:5: F841 local variable 'test' is assigned to but never used
-------- Captured log call --------
flake8.options.manager:: DEBUG: Registered option "Option(-v, --verbose, action=count, default=0, dest=verbose, type=None, callback=None, help=Print more information about what is happening in flake8. This option is repeatable and will increase verbosity each time it is repeated., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
flake8.options.manager:: DEBUG: Registered option "Option(-q, --quiet, action=count, default=0, dest=quiet, type=None, callback=None, help=Report only file names, or nothing. This option is repeatable., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
... lots of additional flake8 log lines ...
flake8.main.application:: INFO: Finished running
flake8.main.application:: INFO: Reporting errors
flake8.style_guide:: DEBUG: Deciding if "F841" should be reported
flake8.style_guide:: DEBUG: The user configured "F841" to be "Selected.Explicitly", "Selected.Implicitly"
flake8.style_guide:: DEBUG: "F841" will be "Decision.Selected"
flake8.style_guide:: DEBUG: Error(code='F841', filename='/home/user/Projects/test/test.py', line_number=12, column_number=5, text="local variable 'test' is assigned to but never used", physical_line=" test = 'test'\n") is not inline ignored
flake8.main.application:: INFO: Found a total of 1 violations and reported 1
========================`
Is there a possibility to turn off flake8 log catching for an entire pytest session with catchlog or would that be possible to add a command line argument for this?
The text was updated successfully, but these errors were encountered: