-
-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |