pytest-flake8

1.3.0 · active · verified Mon Apr 13

pytest-flake8 is a pytest plugin that integrates flake8 into your test suite to check Python code against PEP8, PyFlakes, and McCabe complexity. As of version 1.3.0, it is actively maintained by coherent-oss with regular releases and supports Python >=3.9.

Warnings

Install

Quickstart

After installation, run `pytest --flake8` to execute flake8 checks on all discovered Python files. Configuration for pytest-flake8 specific options (e.g., `flake8-max-line-length` or `flake8-ignore`) should be placed in your `setup.cfg` under the `[tool:pytest]` section or in `pyproject.toml` under `[tool.pytest.ini_options]` if using pytest >= 6.0.

# content of your_module.py
def long_line_function(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12):
    pass

# content of setup.cfg or pyproject.toml
# For setup.cfg:
# [tool:pytest]
# flake8-max-line-length = 79

# For pyproject.toml (requires pytest>=6.0):
# [tool.pytest.ini_options]
# flake8-max-line-length = 79

# Run pytest with flake8 checks
# pytest --flake8 your_module.py

view raw JSON →