pytest-flake8
pytest-flake8 copied to clipboard
Can't stop warnings coming from flake8
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
my pytest.ini
[pytest]
addopts = -p no:warnings
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.
Indeed, adding this in my tox.ini did help for now:
[testenv]
deps = flake8==3.7.3
Silencing the warnings via conftest.py also does the trick: https://github.com/eisensheng/pytest-catchlog/issues/59#issuecomment-601202470.