pytest-flake8

pytest plugin to check FLAKE8 requirements

26 个版本 Python >=3.9
安装
pip install pytest-flake8
poetry add pytest-flake8
pipenv install pytest-flake8
conda install pytest-flake8
描述

.. image:: https://img.shields.io/pypi/v/pytest-flake8.svg :target: https://pypi.org/project/pytest-flake8

.. image:: https://img.shields.io/pypi/pyversions/pytest-flake8.svg

.. image:: https://github.com/coherent-oss/pytest-flake8/actions/workflows/main.yml/badge.svg :target: https://github.com/coherent-oss/pytest-flake8/actions?query=workflow%3A%22tests%22 :alt: tests

.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json :target: https://github.com/astral-sh/ruff :alt: Ruff

.. image:: https://readthedocs.org/projects/pytest-flake8/badge/?version=latest :target: https://pytest-flake8.readthedocs.io/en/latest/?badge=latest

.. image:: https://img.shields.io/badge/skeleton-2024-informational :target: https://blog.jaraco.com/skeleton

pytest plugin for efficiently checking PEP8 compliance

Usage

Install it into a test environment, then run tests with the option.

.. code-block:: bash

pytest --flake8

Every file ending in .py will be discovered and checked with flake8.

.. note::

If optional flake8 plugins are installed, those will
be used automatically. No provisions have been made for
configuring these via `pytest`_.

.. warning::

Running flake8 tests on your project is likely to cause a number 
of issues. The plugin allows one to configure on a per-project and
per-file basis which errors or warnings to ignore, see
flake8-ignore_.

.. _flake8-ignore:

Configuring Flake8

See the Flake8 docs on configuring <https://flake8.pycqa.org/en/latest/user/configuration.html>_.

FAQs

All the Flake8 tests are skipping! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

By design, results are cached and only changed files are checked.

To bypass this caching mechanism, run the following command:

.. code-block:: bash

pytest --cache-clear --flake8

Run tests with tox (e.g. pipx run tox).

For more information, take a look at the skeleton <https://blog.jaraco.com/skeleton/>_.

Notes

For more info on pytest_ see http://pytest.org

The code is partially based on Ronny Pfannschmidt's pytest-codecheckers_ plugin.

.. _pytest: http://pytest.org .. _flake8: https://pypi.python.org/pypi/flake8 .. _pycodestyle: https://pypi.python.org/pypi/pycodestyle .. _pytest-codecheckers: https://pypi.python.org/pypi/pytest-codecheckers

版本列表
1.3.0 2024-11-09
1.2.2 2024-07-21
1.2.1 2024-07-21
1.2.0 2024-07-19
1.1.3 2024-07-19
1.1.2 2024-07-19
1.1.1 2022-03-18
1.1.0 2022-03-05
1.0.7 2020-12-16
1.0.6 2020-05-12
1.0.5 2020-04-23
1.0.4 2019-01-31
1.0.3 2019-01-14
1.0.2 2018-07-26
1.0.1 2018-04-30
1.0.0 2018-03-19
0.9.1 2017-10-26
0.9 2017-10-23
0.8.1 2016-10-18
0.7 2016-10-06
0.6 2016-07-26
0.5 2016-04-21
0.4 2016-04-19
0.3 2016-04-18
0.2 2016-02-12
0.1 2015-03-31