Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate tryfirst mark to hookimpl compat #550

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/pytest_cov/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@

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