Skip to content

Commit 04f02b5

Browse files
blueyedionelmc
authored andcommitted
Use get_closest_marker
Fixes pytest-cov with pytest 4.1. Requires pytest 3.6+ now.
1 parent 2a82832 commit 04f02b5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def run(self):
121121
'cover', 'coverage', 'pytest', 'py.test', 'distributed', 'parallel',
122122
],
123123
install_requires=[
124-
'pytest>=2.9',
124+
'pytest>=3.6',
125125
'coverage>=4.4'
126126
],
127127
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',

src/pytest_cov/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def pytest_runtest_teardown(self, item):
293293

294294
@compat.hookwrapper
295295
def pytest_runtest_call(self, item):
296-
if (item.get_marker('no_cover')
296+
if (item.get_closest_marker('no_cover')
297297
or 'no_cover' in getattr(item, 'fixturenames', ())):
298298
self.cov_controller.pause()
299299
yield

0 commit comments

Comments
 (0)