pytest-flake8 icon indicating copy to clipboard operation
pytest-flake8 copied to clipboard

Can't stop warnings coming from flake8

Open panwarnaveen9 opened this issue 5 years ago • 4 comments

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 avatar May 13 '20 03:05 panwarnaveen9

my pytest.ini

[pytest]
addopts = -p no:warnings

panwarnaveen9 avatar May 13 '20 03:05 panwarnaveen9

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.

GergelyKalmar avatar May 21 '20 11:05 GergelyKalmar

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

[testenv]
deps = flake8==3.7.3

saper avatar May 21 '20 23:05 saper

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

BvB93 avatar Jun 09 '20 13:06 BvB93