Skip to content

Commit

Permalink
Fix definition of cov fixture for pytest 3
Browse files Browse the repository at this point in the history
With pytest 3.0 (not released yet) the following warning gets emitted:

> WC1 None pytest_funcarg__cov: declaring fixtures using
> "pytest_funcarg__" prefix is deprecated and scheduled to be removed in
> pytest 4.0.  Please remove the prefix and use the @pytest.fixture decorator
> instead.
  • Loading branch information
blueyed committed Jul 13, 2016
1 parent c4c42c9 commit 065911e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/pytest_cov/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,9 @@ def pytest_runtest_teardown(self, item):
self.cov = None


def pytest_funcarg__cov(request):
"""A pytest funcarg that provides access to the underlying coverage
object.
"""
@pytest.fixture
def cov(request):
"""A pytest fixture to provide access to the underlying coverage object."""

# Check with hasplugin to avoid getplugin exception in older pytest.
if request.config.pluginmanager.hasplugin('_cov'):
Expand Down

0 comments on commit 065911e

Please sign in to comment.