From 6d2b956c38ff1fc64bf7827df6977b0b05c5d211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Nov=C3=BD?= Date: Tue, 7 Jun 2016 16:47:35 +0200 Subject: [PATCH 1/4] Bump required version pytest to 2.7 test_pytest_pylint.py is failing on 2.6.4 and older --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 37d622e..ee9af44 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ url='https://github.com/carsongee/pytest-pylint', py_modules=['pytest_pylint'], entry_points={'pytest11': ['pylint = pytest_pylint']}, - install_requires=['pytest>=2.4', 'pylint>=1.4.5', 'six'], + install_requires=['pytest>=2.7', 'pylint>=1.4.5', 'six'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', From ca0d82b669d3ee9a479424f2e4ca11a4fd773bfa Mon Sep 17 00:00:00 2001 From: Sebastian Stigler Date: Fri, 22 Jul 2016 16:25:56 +0200 Subject: [PATCH 2/4] Add marker 'pylint' to run pylint checks only You can run `py.test --pylint -m pylint` to just run the linter and no other tests. --- README.rst | 7 +++++++ pytest_pylint.py | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/README.rst b/README.rst index af610d5..08b0eb2 100644 --- a/README.rst +++ b/README.rst @@ -30,6 +30,13 @@ would be the most simple usage and would run pylint for all error messages. This would use the pylintrc file at /my/pyrc and only error on pylint Errors and Failures. +You can restrict your test run to only perform pylint checks and not any other +tests by typing: + +.. code-block:: shell + + py.test --pylint -m pylint + Acknowledgements ================ diff --git a/pytest_pylint.py b/pytest_pylint.py index 7f4fcc5..f27d2c8 100644 --- a/pytest_pylint.py +++ b/pytest_pylint.py @@ -111,6 +111,11 @@ class PyLintItem(pytest.Item, pytest.File): def __init__(self, fspath, parent, msg_format=None, pylintrc_file=None): super(PyLintItem, self).__init__(fspath, parent) + if hasattr(self, 'add_marker'): + self.add_marker("pylint") + else: + self.keywords["pylint"] = True + if msg_format is None: self._msg_format = '{C}:{line:3d},{column:2d}: {msg} ({symbol})' else: From b1ac212f62f6358bb003836e631a7bd91596bebc Mon Sep 17 00:00:00 2001 From: Sebastian Stigler Date: Fri, 22 Jul 2016 21:41:27 +0200 Subject: [PATCH 3/4] simplify the marker --- pytest_pylint.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pytest_pylint.py b/pytest_pylint.py index f27d2c8..65b0df0 100644 --- a/pytest_pylint.py +++ b/pytest_pylint.py @@ -111,10 +111,7 @@ class PyLintItem(pytest.Item, pytest.File): def __init__(self, fspath, parent, msg_format=None, pylintrc_file=None): super(PyLintItem, self).__init__(fspath, parent) - if hasattr(self, 'add_marker'): - self.add_marker("pylint") - else: - self.keywords["pylint"] = True + self.add_marker("pylint") if msg_format is None: self._msg_format = '{C}:{line:3d},{column:2d}: {msg} ({symbol})' From 9d509b6c931e1f6f6c08c4dcfe016382caea904a Mon Sep 17 00:00:00 2001 From: Carson Gee Date: Sat, 23 Jul 2016 09:57:44 -0400 Subject: [PATCH 4/4] Released 0.6.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ee9af44..49cf286 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ description='pytest plugin to check source code with pylint', long_description=open("README.rst").read(), license="MIT", - version='0.5.0', + version='0.6.0', author='Carson Gee', author_email='x@carsongee.com', url='https://github.com/carsongee/pytest-pylint',