Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest-flake8 breaks setup.py test #28

Open
andreas-h opened this issue Aug 22, 2017 · 3 comments
Open

pytest-flake8 breaks setup.py test #28

andreas-h opened this issue Aug 22, 2017 · 3 comments

Comments

@andreas-h
Copy link

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
Copy link
Author

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

@hameerabbasi
Copy link

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

@pelt
Copy link

pelt commented Feb 9, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants