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

Issue with pytest_collect_ignore implementation #223

Open
bluetech opened this issue Jun 10, 2023 · 0 comments
Open

Issue with pytest_collect_ignore implementation #223

bluetech opened this issue Jun 10, 2023 · 0 comments

Comments

@bluetech
Copy link

Hi, pytest developer here, coming from here.

This plugin implements the pytest_collect_ignore hook here:

def pytest_ignore_collect(path, config):
"""
pytest hook that determines if pytest looks at specific file to collect tests
if repo_health is set to true:
only tests in test files with "repo_health" in their path will be collected
"""
if config.getoption("repo_health"):
if "/repo_health" not in str(path):
return True
return False

This hook has "firstresult" semantics, which means that if a plugin returns a non-None result, this is the result and further processing is stopped. This plugin does return False in the non-ignored case, but due to firstresult what it should do is return None to allow other plugins (including pytest itself) to perform their ignores.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant