Skip to content
Merged
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
23 changes: 11 additions & 12 deletions test/pytest_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@


def pytest_collection_modifyitems(items, config):
sync_items = []
async_items = [
item
for item in items
if "asynchronous" in item.fspath.dirname or sync_items.append(item) # type: ignore[func-returns-value]
]
for item in async_items:
if not any(item.iter_markers()):
item.add_marker("default_async")
for item in sync_items:
if not any(item.iter_markers()):
item.add_marker("default")
# Markers that should overlap with the default markers.
overlap_markers = ["async"]

for item in items:
if "asynchronous" in item.fspath.dirname:
default_marker = "default_async"
else:
default_marker = "default"
markers = [m for m in item.iter_markers() if m not in overlap_markers]
if not markers:
item.add_marker(default_marker)
Loading