Skip to content

Commit 85c40c3

Browse files
committed
Apply the isolated marker to all tests that utilise capsys.
Signed-off-by: davem-bis <68955845+davem-bis@users.noreply.github.com>
1 parent 4c54937 commit 85c40c3

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎tests/conftest.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,12 @@ def pytest_collection_modifyitems(items, *args, **kwargs):
216216
if marker.name in test_type_markers:
217217
break
218218
else:
219-
# if no test type marker is found, assume fast test
220-
item.add_marker("fast")
219+
# If no test type marker is found, assume it is a fast or isolated test.
220+
if "capsys" in item.fixturenames:
221+
# capsys is not threadsafe, so the test must be isolated.
222+
item.add_marker("isolated")
223+
else:
224+
item.add_marker("fast")
221225

222226

223227
# Ignore all local config files

0 commit comments

Comments
 (0)