Skip to content

Commit

Permalink
Add custom selection
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Jun 20, 2023
1 parent 3eb87c7 commit bcfdbac
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion holoviews/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
from panel.tests.conftest import server_cleanup, port, pytest_addoption, pytest_collection_modifyitems, pytest_configure # noqa
from panel.tests.conftest import server_cleanup, port, pytest_addoption, pytest_configure, optional_markers # noqa


def pytest_collection_modifyitems(config, items):
skipped, selected = [], []
markers = [m for m in optional_markers if config.getoption(f"--{m}")]
empty = not markers
for item in items:
if empty and any(m in item.keywords for m in optional_markers):
skipped.append(item)
elif empty:
selected.append(item)
elif not empty and any(m in item.keywords for m in markers):
selected.append(item)
else:
skipped.append(item)

config.hook.pytest_deselected(items=skipped)
items[:] = selected

0 comments on commit bcfdbac

Please sign in to comment.