Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/pytest-dev/pytest-cov/pull/263>`_.

2.6.1 (2019-01-07)
------------------

Expand Down
6 changes: 4 additions & 2 deletions src/pytest_cov/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,17 @@ 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):
"""Delegate to our implementation.

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):
Expand Down
10 changes: 10 additions & 0 deletions tests/test_pytest_cov.py
Original file line number Diff line number Diff line change
Expand Up @@ -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