Pytest-flake8
lastmod 2026-11-10created 2020-12-145 edits
pytest-flake8 is a pytest plugin that checks each Python file with flake8 when pytest runs and reports code style violations as test failures. It is enabled with the --flake8 option, and the flake8-ignore entry in the configuration file specifies error codes to ignore per file pattern. It offers the convenience of running linting and tests with a single command, but today running flake8 or ruff separately in a pre-commit hook or CI is more common.
Ignore patterns
See also
- pytest
- python
- flake8
- pycodestyle - Simple Python style checker in one Python file