Skip to content

Commit db0eb29

Browse files
committed
add pytest-xdist as test dependence
1 parent cd21d15 commit db0eb29

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

ingestion/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@
433433
"pytest==7.0.1",
434434
"pytest-cov",
435435
"pytest-order",
436+
"pytest-xdist",
436437
"dirty-equals",
437438
# install dbt dependency
438439
"collate-dbt-artifacts-parser",

ingestion/tests/unit/conftest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@
2727
_mock_health.start()
2828

2929

30+
@fixture(scope="session")
31+
def worker_id(request):
32+
"""Fallback worker_id fixture for when pytest-xdist is not installed.
33+
34+
When xdist is active, request.config.workerinput contains the worker id.
35+
Otherwise, return "master" (single-process mode).
36+
"""
37+
if hasattr(request.config, "workerinput"):
38+
return request.config.workerinput["workerid"]
39+
return "master"
40+
41+
3042
@fixture(scope="session", autouse=True)
3143
def register_sqlite_math_functions():
3244
"""

0 commit comments

Comments
 (0)