Skip to content

Commit

Permalink
migrate tryfirst mark to hookimpl compat
Browse files Browse the repository at this point in the history
  • Loading branch information
RonnyPfannschmidt committed Jul 31, 2022
1 parent 00713b3 commit 37096e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/pytest_cov/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@

if hasattr(pytest, 'hookimpl'):
hookwrapper = pytest.hookimpl(hookwrapper=True)
tryfirst = pytest.hookimpl(tryfirst=True)
else:
hookwrapper = pytest.mark.hookwrapper
tryfirst = pytest.mark.tryfirst



class SessionWrapper:
Expand Down
2 changes: 1 addition & 1 deletion src/pytest_cov/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def _prepare_cov_source(cov_source):
return None if True in cov_source else [path for path in cov_source if path is not True]


@pytest.mark.tryfirst
@compat.tryfirst
def pytest_load_initial_conftests(early_config, parser, args):
options = early_config.known_args_namespace
no_cov = options.no_cov_should_warn = False
Expand Down

0 comments on commit 37096e5

Please sign in to comment.