diff --git a/AUTHORS.rst b/AUTHORS.rst index 41cc6055..78f18f13 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -28,3 +28,4 @@ Authors * Jeremy Bowman - https://github.com/jmbowman * Samuel Giffard - https://github.com/Mulugruntz * Семён Марьясин - https://github.com/MarSoft +* Alexander Shadchin - https://github.com/shadchin diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0583e5ac..1bb5b4fd 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,12 @@ Changelog ========= +2.6.2 (2019-02-05) +------------------ + +* Fixed ``'NoneType' object has no attribute 'configure_node'`` issue. + Contributed by Alexander Shadchin in `#263 `_. + 2.6.1 (2019-01-07) ------------------ diff --git a/src/pytest_cov/plugin.py b/src/pytest_cov/plugin.py index 2ea47f64..619b9a38 100644 --- a/src/pytest_cov/plugin.py +++ b/src/pytest_cov/plugin.py @@ -195,7 +195,8 @@ def pytest_configure_node(self, node): Mark this hook as optional in case xdist is not installed. """ - self.cov_controller.configure_node(node) + if not self._disabled: + self.cov_controller.configure_node(node) pytest_configure_node.optionalhook = True def pytest_testnodedown(self, node, error): @@ -203,7 +204,8 @@ def pytest_testnodedown(self, node, error): Mark this hook as optional in case xdist is not installed. """ - self.cov_controller.testnodedown(node, error) + if not self._disabled: + self.cov_controller.testnodedown(node, error) pytest_testnodedown.optionalhook = True def _should_report(self): diff --git a/tests/test_pytest_cov.py b/tests/test_pytest_cov.py index b3600794..da44e19a 100644 --- a/tests/test_pytest_cov.py +++ b/tests/test_pytest_cov.py @@ -1439,3 +1439,13 @@ def test_double_cov2(testdir): '*1 passed*' ]) assert result.ret == 0 + + +def test_cov_and_no_cov(testdir): + script = testdir.makepyfile(SCRIPT_SIMPLE) + result = testdir.runpytest('-v', + '--cov', '--no-cov', + '-n', '1', + script) + + assert result.ret == 0