Skip to content

Commit b8fd024

Browse files
committed
Modified conftest to ensure that the isolated is added to all tests utilising capsys, not just fast tests.
Signed-off-by: davem-bis <68955845+davem-bis@users.noreply.github.com>
1 parent 696d76a commit b8fd024

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

‎Makefile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,13 @@ engine-up: engine-clickhouse-up engine-mssql-up engine-mysql-up engine-postgres-
132132
engine-down: engine-clickhouse-down engine-mssql-down engine-mysql-down engine-postgres-down engine-spark-down engine-trino-down
133133

134134
fast-test:
135-
pytest -n auto -m "fast and not cicdonly" --junitxml=test-results/junit-fast-test.xml && pytest -m "isolated" && pytest -m "registry_isolation" && pytest -m "dialect_isolated"
135+
pytest -n auto -m "fast and not cicdonly and not isolated" --junitxml=test-results/junit-fast-test.xml && pytest -m "isolated and not slow" && pytest -m "registry_isolation" && pytest -m "dialect_isolated"
136136

137137
slow-test:
138-
pytest -n auto -m "(fast or slow) and not cicdonly" && pytest -m "isolated" && pytest -m "registry_isolation" && pytest -m "dialect_isolated"
138+
pytest -n auto -m "(fast or slow) and not cicdonly and not isolated" && pytest -m "isolated" && pytest -m "registry_isolation" && pytest -m "dialect_isolated"
139139

140140
cicd-test:
141-
pytest -n auto -m "(fast or slow) and not pyspark" --junitxml=test-results/junit-cicd.xml && pytest -m "pyspark" && pytest -m "isolated" && pytest -m "registry_isolation" && pytest -m "dialect_isolated"
141+
pytest -n auto -m "(fast or slow) and not pyspark and not isolated" --junitxml=test-results/junit-cicd.xml && pytest -m "pyspark" && pytest -m "isolated" && pytest -m "registry_isolation" && pytest -m "dialect_isolated"
142142

143143
core-fast-test:
144144
pytest -n auto -m "fast and not web and not github and not dbt and not jupyter"

‎tests/conftest.py‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,16 +212,14 @@ def pytest_collection_modifyitems(items, *args, **kwargs):
212212
"dialect_isolated",
213213
}
214214
for item in items:
215+
if "capsys" in item.fixturenames:
216+
# capsys is not threadsafe, so the test must be isolated.
217+
item.add_marker("isolated")
215218
for marker in item.iter_markers():
216219
if marker.name in test_type_markers:
217220
break
218221
else:
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")
222+
item.add_marker("fast")
225223

226224

227225
# Ignore all local config files

0 commit comments

Comments
 (0)