From 065911eea811a4d305d496b0b8c9e2cd61e26e4d Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 12 Jul 2016 23:53:45 +0200 Subject: [PATCH] Fix definition of `cov` fixture for pytest 3 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. --- src/pytest_cov/plugin.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/pytest_cov/plugin.py b/src/pytest_cov/plugin.py index 0c6d378e..2812d2bc 100644 --- a/src/pytest_cov/plugin.py +++ b/src/pytest_cov/plugin.py @@ -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'):