From bc9c6ff1f9e84c71e09a9ccdbaf472daf0ad2847 Mon Sep 17 00:00:00 2001 From: Michael McNeil Forbes Date: Sun, 11 Dec 2016 16:12:21 -0800 Subject: [PATCH 1/4] Potential fix for issue #8 Ignore options are properly loaded from ``setup.cfg`` but then overwritten. Here we simply extend this list. --- pytest_flake8.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest_flake8.py b/pytest_flake8.py index b5789ac..8c3166b 100644 --- a/pytest_flake8.py +++ b/pytest_flake8.py @@ -180,7 +180,7 @@ def check_file(path, flake8ignore, maxlength, maxcomplexity, app.find_plugins() app.register_plugin_options() app.parse_configuration_and_cli(args) - app.options.ignore = flake8ignore + app.options.ignore.extend(flake8ignore) app.make_formatter() # fix this app.make_notifier() app.make_guide() From 85e0a8b1a23708ddfdcda5b87da7a34b968f2666 Mon Sep 17 00:00:00 2001 From: alex-dr Date: Thu, 1 Jun 2017 11:53:08 -0400 Subject: [PATCH 2/4] Add pytest marker for flake8 This is required for compatibility with pytest --strict mode when using pytest>=3.1 as discussed in https://github.com/pytest-dev/pytest/issues/2455 --- pytest_flake8.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pytest_flake8.py b/pytest_flake8.py index 8c3166b..f7e1b98 100644 --- a/pytest_flake8.py +++ b/pytest_flake8.py @@ -51,6 +51,7 @@ def pytest_configure(config): config._flake8showshource = config.getini("flake8-show-source") config._flake8statistics = config.getini("flake8-statistics") config._flake8exts = config.getini("flake8-extensions") + config.addinivalue_line('markers', "flake8: Tests which run flake8.") if hasattr(config, 'cache'): config._flake8mtimes = config.cache.get(HISTKEY, {}) From 1e272da1f7b5dbca857001df760bbc5bdff5ff0b Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 23 Oct 2017 15:54:48 +0200 Subject: [PATCH 3/4] Make the plugin compatible with flake8 3.5.0. --- pytest_flake8.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytest_flake8.py b/pytest_flake8.py index 8c3166b..6bea7c7 100644 --- a/pytest_flake8.py +++ b/pytest_flake8.py @@ -177,6 +177,8 @@ def check_file(path, flake8ignore, maxlength, maxcomplexity, if statistics: args += ['--statistics'] app = application.Application() + app.parse_preliminary_options_and_args(args) + app.make_config_finder() app.find_plugins() app.register_plugin_options() app.parse_configuration_and_cli(args) From 8023cb5eb47a3d06be26ba045b002e7cd1d1ab99 Mon Sep 17 00:00:00 2001 From: alex-dr Date: Thu, 1 Jun 2017 11:53:08 -0400 Subject: [PATCH 4/4] Add pytest marker for flake8 This is required for compatibility with pytest --strict mode when using pytest>=3.1 as discussed in https://github.com/pytest-dev/pytest/issues/2455 --- pytest_flake8.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pytest_flake8.py b/pytest_flake8.py index 6bea7c7..2ac7a28 100644 --- a/pytest_flake8.py +++ b/pytest_flake8.py @@ -51,6 +51,7 @@ def pytest_configure(config): config._flake8showshource = config.getini("flake8-show-source") config._flake8statistics = config.getini("flake8-statistics") config._flake8exts = config.getini("flake8-extensions") + config.addinivalue_line('markers', "flake8: Tests which run flake8.") if hasattr(config, 'cache'): config._flake8mtimes = config.cache.get(HISTKEY, {})