Giter Site home page Giter Site logo

pytest-pylint-xdist-vcs's Introduction

Build Status Coverage Status pypi supported versions

Table of Contents

Description

Pytest Plugin for distributed linting with pylint of VCS controlled files. This project is hypothetically can work with any pytest test parallelization plugin (pytest-parallel?) as it doesn't depend on any xdist specific design.

Differences between pytest-pylint and this plug-in:

Added

  • pylint works in single job mode so that to allow parallelization with xdist

  • when test result is printed into terminal (with -v verbose flag) it contains pylint tag [pylint]

  • vcs mode enables linting only python files modified / added in the working copy latest revision

    If working copy not found, the linting falls back to "all files linting".

Removed

  • skipping of linted file that was already linted as it duplicates functionality of xdist (mtimes cache recording)

  • Python 2 and Pylint 1.x support

  • --pylint-jobs option as multi processing managed by xdist

  • display only particular error codes (option --pylint-error-types ) as it is already available via .pylintrc Message Control section

    See http://pylint.pycqa.org/en/latest/user_guide/message-control.html for detail

Terminal output example

Verbose output

$ pytest -v --pylint -m pylint
[gw0] [ 50%] PASSED tests/test_devices.py[pylint] <- tests/test_devices.py
[gw0] [ 1000%] FAILED tests/test_environment.py[pylint] <- tests/test_environment.py

Non-verbose output (only filenames / modules displayed):

collected 2 items

mymodule/__init__.py[pylint] .                              [ 50%]
mymodule/test_file.py[pylint] F                             [100%]

Prerequisites

  • Linux OS

  • SVN 1.8+ (for svn repo linting)

  • Terminal locale set as UTF-8

    Plugin uses terminal locale and assumes that it is set as UTF-8 encoding (en_GB.utf8, pl_pl.utf8, ru_RU.utf8, etc)

  • Python 3.5+

Usage examples

  • this runs pylint for all error messages.
   py.test --pylint
  • the same as above but utilizing all available processor cores.
   py.test --pylint --numprocesses=auto
  • This would use the pylintrc file at /my/pyrc:
   py.test --pylint --pylint-rcfile=/my/pyrc
  • You can restrict your test run to only perform pylint checks by typing:
    py.test --pylint -m pylint

If plugin runs the check of VCS working copy, then you can lint only files changed / added in the last revision

    py.test --pylint-vcs -m pylint

Embedding into conf files

You can embed this into setup.cfg:

[tool:pytest]
addopts= --pylint-vcs

or into tox.ini

[pytest]
addopts = --pylint-vcs

Acknowledgements

This code is a fork of pytest-pylint 0.14.0

pytest-pylint-xdist-vcs's People

Contributors

alexor2 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.