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

Registered markers and modified checks collection code #259

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
17 changes: 5 additions & 12 deletions pytest_repo_health/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ def pytest_configure(config):
"""
pytest hook used to add plugin install dir as place for pytest to find tests
"""
# Registering edx_health and py_dependency_health markers
config.addinivalue_line(
"markers", "edx_health: custom marker to select edx and openedx health checks\n"
"py_dependency_health: custom marker to select py dependencies health checks"
)

if config.getoption("repo_health"):

Expand Down Expand Up @@ -137,18 +142,6 @@ def repo_health(request):
return request.config.option.repo_health


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 None


# Unused argument "session", but pylint complains if it is renamed "_session"
# pylint: disable=unused-argument
def pytest_collection_modifyitems(session, config, items):
Expand Down
Loading