From 85c40c3e25fd928897d5cfc4b253201bdc32d2ec Mon Sep 17 00:00:00 2001 From: davem-bis <68955845+davem-bis@users.noreply.github.com> Date: Wed, 2 Sep 2026 13:55:56 +0100 Subject: [PATCH] Apply the isolated marker to all tests that utilise capsys. Signed-off-by: davem-bis <68955845+davem-bis@users.noreply.github.com> --- tests/conftest.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 4d1bb23577..3d1928fba2 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -216,8 +216,12 @@ def pytest_collection_modifyitems(items, *args, **kwargs): if marker.name in test_type_markers: break else: - # if no test type marker is found, assume fast test - item.add_marker("fast") + # If no test type marker is found, assume it is a fast or isolated test. + if "capsys" in item.fixturenames: + # capsys is not threadsafe, so the test must be isolated. + item.add_marker("isolated") + else: + item.add_marker("fast") # Ignore all local config files