From 457f2f786f5c9b89c5c83f6d613368fa316e9cce Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 21 Oct 2024 10:40:20 -0500 Subject: [PATCH 1/2] PYTHON-4894 Fix handling of auth test marker --- test/pytest_conf.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/test/pytest_conf.py b/test/pytest_conf.py index 75f3e74322..1f1e0d5091 100644 --- a/test/pytest_conf.py +++ b/test/pytest_conf.py @@ -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_markes() if m not in overlap_markers] + if not markers: + item.add_marker(default_marker) From 0b23fc53b7283f3472d478ac4af0eba10d64fb48 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 21 Oct 2024 10:42:05 -0500 Subject: [PATCH 2/2] spelling --- test/pytest_conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/pytest_conf.py b/test/pytest_conf.py index 1f1e0d5091..a6e24cd9b1 100644 --- a/test/pytest_conf.py +++ b/test/pytest_conf.py @@ -10,6 +10,6 @@ def pytest_collection_modifyitems(items, config): default_marker = "default_async" else: default_marker = "default" - markers = [m for m in item.iter_markes() if m not in overlap_markers] + markers = [m for m in item.iter_markers() if m not in overlap_markers] if not markers: item.add_marker(default_marker)