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

pytest-flake8 breaks `setup.py test`

Open andreas-h opened this issue 8 years ago • 3 comments

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!

andreas-h avatar Aug 22 '17 13:08 andreas-h

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 ...

andreas-h avatar Aug 22 '17 13:08 andreas-h

Maybe try a dedicated [flake8] section in your setup.cfg?

hameerabbasi avatar Jul 19 '18 15:07 hameerabbasi

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?

pelt avatar Feb 09 '19 22:02 pelt