Skip to content

Commit 065911e

Browse files
committed
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.
1 parent c4c42c9 commit 065911e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/pytest_cov/plugin.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,9 @@ def pytest_runtest_teardown(self, item):
254254
self.cov = None
255255

256256

257-
def pytest_funcarg__cov(request):
258-
"""A pytest funcarg that provides access to the underlying coverage
259-
object.
260-
"""
257+
@pytest.fixture
258+
def cov(request):
259+
"""A pytest fixture to provide access to the underlying coverage object."""
261260

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

0 commit comments

Comments
 (0)