pytest-flake8
pytest-flake8 copied to clipboard
pytest-flake8 breaks `setup.py test`
Following the docs, I added the flake8-ignore setting to my setup.cfg, which now looks like this:
[aliases]
test=pytest
[tool:pytest]
addopts = --verbose
[pytest]
flake8-ignore =
setup.py F401
docs/conf.py ALL
tests/context.py E402 F401
However, when I run python setup.py test, I get the error
error: error in setup.cfg: command 'PyTest' has no such option 'flake8_ignore'
I should mention that py.test --flake8 works.
Any help is greatly appreciated!
When I switch the flake8-ignore option to the [tool:pytest] section,
[aliases]
test=pytest
[tool:pytest]
addopts = --verbose --flake8
flake8-ignore =
setup.py F401
docs/conf.py ALL
tests/context.py E402 F401
I don't get an error, but the flake8 tests are not run, either ...
Maybe try a dedicated [flake8] section in your setup.cfg?
I wrote a package (https://github.com/pelt/demo_flake8_config_issue/tree/master) to reproduce the issue but I couldn't. Your second configuration is fine where flake8-ignore is part of tools:pytest and works in my case. The output says that the flake8 checks are executed on the files.
Did I understand your issue correctly?