Skip to content

Commit 37096e5

Browse files
migrate tryfirst mark to hookimpl compat
1 parent 00713b3 commit 37096e5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/pytest_cov/compat.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010

1111
if hasattr(pytest, 'hookimpl'):
1212
hookwrapper = pytest.hookimpl(hookwrapper=True)
13+
tryfirst = pytest.hookimpl(tryfirst=True)
1314
else:
1415
hookwrapper = pytest.mark.hookwrapper
16+
tryfirst = pytest.mark.tryfirst
17+
1518

1619

1720
class SessionWrapper:

src/pytest_cov/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def _prepare_cov_source(cov_source):
133133
return None if True in cov_source else [path for path in cov_source if path is not True]
134134

135135

136-
@pytest.mark.tryfirst
136+
@compat.tryfirst
137137
def pytest_load_initial_conftests(early_config, parser, args):
138138
options = early_config.known_args_namespace
139139
no_cov = options.no_cov_should_warn = False

0 commit comments

Comments
 (0)