pytest-flake8


Namepytest-flake8 JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/tholo/pytest-flake8
Summarypytest plugin to check FLAKE8 requirements
upload_time2018-04-30 19:42:59
maintainer
docs_urlNone
authorThorsten Lockert
requires_python
licenseBSD License
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            pytest plugin for efficiently checking PEP8 compliance 
======================================================

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

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

.. image:: https://img.shields.io/pypi/implementation/pytest-flake8.svg
    :target: https://pypi.python.org/pypi/pytest-flake8

.. image:: https://img.shields.io/pypi/status/pytest-flake8.svg
    :target: https://pypi.python.org/pypi/pytest-flake8

.. image:: https://travis-ci.org/tholo/pytest-flake8.svg?branch=master
    :target: https://travis-ci.org/tholo/pytest-flake8

.. image:: https://img.shields.io/github/issues/tholo/pytest-flake8.svg
    :target: https://github.com/tholo/pytest-flake8/issues

.. image:: https://img.shields.io/github/issues-pr/tholo/pytest-flake8.svg
    :target: https://github.com/tholo/pytest-flake8/pulls

Usage
-----

Install by running the command::

    pip install pytest-flake8

After installing it, when you run tests with the option::

    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 options per project and file
-----------------------------------------------

Maximum line length can be configured for the whole project
by adding a ``flake8-max-line-length`` option to your ``setup.cfg``
or ``tox.ini`` file like this::

    # content of setup.cfg
    [pytest]
    flake8-max-line-length = 99

Note that the default will be what naturally comes with `flake8`_
(which it turn gets its default from `pycodestyle`_).

You may configure flake8-checking options for your project
by adding an ``flake8-ignore`` entry to your ``setup.cfg``
or ``tox.ini`` file like this::

    # content of setup.cfg
    [pytest]
    flake8-ignore = E201 E231

This would globally prevent complaints about two whitespace issues.
Rerunning with the above example will now look better::

    $ pytest -q  --flake8
    collecting ... collected 1 items
    .
    1 passed in 0.01 seconds

If you have some files where you want to specifically ignore 
some errors or warnings you can start a flake8-ignore line with 
a glob-pattern and a space-separated list of codes::

    # content of setup.cfg
    [pytest]
    flake8-ignore = 
        *.py E201
        doc/conf.py ALL

So if you have a conf.py like this::

    # content of doc/conf.py

    func (  [1,2,3]) #this line lots PEP8 errors :)

then running again with the previous example will show a single
failure and it will ignore doc/conf.py alltogether::

    $ pytest --flake8 -v # verbose shows what is ignored
    ======================================= test session starts ========================================
    platform darwin -- Python 2.7.6 -- py-1.4.26 -- pytest-2.7.0 -- /Users/tholo/Source/pytest/bin/python
    cachedir: /Users/tholo/Source/pytest/src/verify/.cache
    rootdir: /Users/tholo/Source/angular/src/verify, inifile: setup.cfg
    plugins: flake8, cache
    collected 1 items

    myfile.py PASSED

    ========================================= 1 passed in 0.00 seconds =========================================

Note that doc/conf.py was not considered or imported.

Notes
-----

The repository of this plugin is at https://github.com/tholo/pytest-flake8

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



            

Raw data

            {
    "maintainer": "", 
    "docs_url": null, 
    "requires_python": "", 
    "maintainer_email": "", 
    "keywords": "", 
    "upload_time": "2018-04-30 19:42:59", 
    "author": "Thorsten Lockert", 
    "home_page": "https://github.com/tholo/pytest-flake8", 
    "github_user": "tholo", 
    "download_url": "https://files.pythonhosted.org/packages/99/d4/a507e16075ae1788a9efd203045f2f9c26f26ba8899c751f9aa76a407787/pytest-flake8-1.0.1.tar.gz", 
    "platform": "", 
    "version": "1.0.1", 
    "description": "pytest plugin for efficiently checking PEP8 compliance \n======================================================\n\n.. image:: https://img.shields.io/pypi/v/pytest-flake8.svg\n    :target: https://pypi.python.org/pypi/pytest-flake8\n\n.. image:: https://img.shields.io/pypi/pyversions/pytest-flake8.svg\n    :target: https://pypi.python.org/pypi/pytest-flake8\n\n.. image:: https://img.shields.io/pypi/implementation/pytest-flake8.svg\n    :target: https://pypi.python.org/pypi/pytest-flake8\n\n.. image:: https://img.shields.io/pypi/status/pytest-flake8.svg\n    :target: https://pypi.python.org/pypi/pytest-flake8\n\n.. image:: https://travis-ci.org/tholo/pytest-flake8.svg?branch=master\n    :target: https://travis-ci.org/tholo/pytest-flake8\n\n.. image:: https://img.shields.io/github/issues/tholo/pytest-flake8.svg\n    :target: https://github.com/tholo/pytest-flake8/issues\n\n.. image:: https://img.shields.io/github/issues-pr/tholo/pytest-flake8.svg\n    :target: https://github.com/tholo/pytest-flake8/pulls\n\nUsage\n-----\n\nInstall by running the command::\n\n    pip install pytest-flake8\n\nAfter installing it, when you run tests with the option::\n\n    pytest --flake8\n\nevery file ending in ``.py`` will be discovered and checked with\nflake8.\n\n.. note::\n\n    If optional flake8 plugins are installed, those will\n    be used automatically. No provisions have been made for\n    configuring these via `pytest`_.\n\n.. warning::\n\n    Running flake8 tests on your project is likely to cause a number \n    of issues. The plugin allows one to configure on a per-project and\n    per-file basis which errors or warnings to ignore, see\n    flake8-ignore_.\n\n.. _flake8-ignore:\n\nConfiguring FLAKE8 options per project and file\n-----------------------------------------------\n\nMaximum line length can be configured for the whole project\nby adding a ``flake8-max-line-length`` option to your ``setup.cfg``\nor ``tox.ini`` file like this::\n\n    # content of setup.cfg\n    [pytest]\n    flake8-max-line-length = 99\n\nNote that the default will be what naturally comes with `flake8`_\n(which it turn gets its default from `pycodestyle`_).\n\nYou may configure flake8-checking options for your project\nby adding an ``flake8-ignore`` entry to your ``setup.cfg``\nor ``tox.ini`` file like this::\n\n    # content of setup.cfg\n    [pytest]\n    flake8-ignore = E201 E231\n\nThis would globally prevent complaints about two whitespace issues.\nRerunning with the above example will now look better::\n\n    $ pytest -q  --flake8\n    collecting ... collected 1 items\n    .\n    1 passed in 0.01 seconds\n\nIf you have some files where you want to specifically ignore \nsome errors or warnings you can start a flake8-ignore line with \na glob-pattern and a space-separated list of codes::\n\n    # content of setup.cfg\n    [pytest]\n    flake8-ignore = \n        *.py E201\n        doc/conf.py ALL\n\nSo if you have a conf.py like this::\n\n    # content of doc/conf.py\n\n    func (  [1,2,3]) #this line lots PEP8 errors :)\n\nthen running again with the previous example will show a single\nfailure and it will ignore doc/conf.py alltogether::\n\n    $ pytest --flake8 -v # verbose shows what is ignored\n    ======================================= test session starts ========================================\n    platform darwin -- Python 2.7.6 -- py-1.4.26 -- pytest-2.7.0 -- /Users/tholo/Source/pytest/bin/python\n    cachedir: /Users/tholo/Source/pytest/src/verify/.cache\n    rootdir: /Users/tholo/Source/angular/src/verify, inifile: setup.cfg\n    plugins: flake8, cache\n    collected 1 items\n\n    myfile.py PASSED\n\n    ========================================= 1 passed in 0.00 seconds =========================================\n\nNote that doc/conf.py was not considered or imported.\n\nNotes\n-----\n\nThe repository of this plugin is at https://github.com/tholo/pytest-flake8\n\nFor more info on `pytest`_ see http://pytest.org\n\nThe code is partially based on Ronny Pfannschmidt's `pytest-codecheckers`_ plugin.\n\n.. _`pytest`: http://pytest.org\n.. _`flake8`: https://pypi.python.org/pypi/flake8\n.. _`pycodestyle`: https://pypi.python.org/pypi/pycodestyle\n.. _`pytest-codecheckers`: https://pypi.python.org/pypi/pytest-codecheckers\n\n\n", 
    "tox": true, 
    "lcname": "pytest-flake8", 
    "name": "pytest-flake8", 
    "github": true, 
    "coveralls": false, 
    "bugtrack_url": null, 
    "license": "BSD License", 
    "travis_ci": true, 
    "github_project": "pytest-flake8", 
    "summary": "pytest plugin to check FLAKE8 requirements", 
    "split_keywords": [], 
    "author_email": "tholo@sigmasoft.com", 
    "urls": [
        {
            "has_sig": false, 
            "upload_time": "2018-04-30T19:42:58", 
            "comment_text": "", 
            "python_version": "py2.py3", 
            "url": "https://files.pythonhosted.org/packages/1e/41/84bff189d67a3122b8e86d43d2421aa94f882507b733d8c762b9051f129a/pytest_flake8-1.0.1-py2.py3-none-any.whl", 
            "md5_digest": "73d59a78b79bec3a75704f0a5389b4ca", 
            "downloads": -1, 
            "filename": "pytest_flake8-1.0.1-py2.py3-none-any.whl", 
            "packagetype": "bdist_wheel", 
            "digests": {
                "sha256": "ec248d4a215d6c7cd9d3ca48f365ece0e3892b46d626c22a95ccc80188ff35ed", 
                "md5": "73d59a78b79bec3a75704f0a5389b4ca"
            }, 
            "size": 5205
        }, 
        {
            "has_sig": false, 
            "upload_time": "2018-04-30T19:42:59", 
            "comment_text": "", 
            "python_version": "source", 
            "url": "https://files.pythonhosted.org/packages/99/d4/a507e16075ae1788a9efd203045f2f9c26f26ba8899c751f9aa76a407787/pytest-flake8-1.0.1.tar.gz", 
            "md5_digest": "4fd0c2878e8ce8fbdd5fd6c20cb3cefb", 
            "downloads": -1, 
            "filename": "pytest-flake8-1.0.1.tar.gz", 
            "packagetype": "sdist", 
            "digests": {
                "sha256": "e5cdc4f459c9436ac6c649e428a014bb5988605858549397374ec29a776cae68", 
                "md5": "4fd0c2878e8ce8fbdd5fd6c20cb3cefb"
            }, 
            "size": 7938
        }
    ], 
    "_id": null
}