tholo / pytest-flake8

pytest plugin to run flake8
Other
117 stars 47 forks source link

Can't stop warnings coming from flake8 #69

Open panwarnaveen9 opened 4 years ago

panwarnaveen9 commented 4 years ago

I am keep on getting this log with every check.. Can I stopped them ?

---------------------------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------------------------
WARNING  flake8.options.manager:manager.py:211 option --max-complexity: please update from optparse string `type=` to argparse callable `type=` -- this will be an error in the future
WARNING  flake8.options.manager:manager.py:189 option --ignore-names: please update `help=` text to use %(default)s instead of %default -- this will be an error in the future
WARNING  flake8.options.manager:manager.py:211 option --ignore-names: please update from optparse string `type=` to argparse callable `type=` -- this will be an error in the future
WARNING  flake8.options.manager:manager.py:189 option --classmethod-decorators: please update `help=` text to use %(default)s instead of %default -- this will be an error in the future
WARNING  flake8.options.manager:manager.py:211 option --classmethod-decorators: please update from optparse string `type=` to argparse callable `type=` -- this will be an error in the future
WARNING  flake8.options.manager:manager.py:189 option --staticmethod-decorators: please update `help=` text to use %(default)s instead of %default -- this will be an error in the future
WARNING  flake8.options.manager:manager.py:211 option --staticmethod-decorators: please update from optparse string `type=` to argparse callable `type=` -- this will be an error in the future
panwarnaveen9 commented 4 years ago

my pytest.ini

[pytest]
addopts = -p no:warnings
GergelyKalmar commented 4 years ago

I think this is a result of flake8 moving to argparse in this release: https://flake8.pycqa.org/en/latest/release-notes/3.8.0.html#a1-2020-04-24

Until pytest-flake8 fixes this you may pin your flake8 version to 3.7.9, that should make the warnings disappear for now.

saper commented 4 years ago

Indeed, adding this in my tox.ini did help for now:

[testenv]
deps = flake8==3.7.3
BvB93 commented 4 years ago

Silencing the warnings via conftest.py also does the trick: https://github.com/eisensheng/pytest-catchlog/issues/59#issuecomment-601202470.