Skip to content

Commit 206277f

Browse files
Use pytest-xdist to distribute tests across CPUs (#506)
* Use pytest-xdist to distribute tests across CPUs * Update pyproject.toml Co-authored-by: Tom Nicholas <[email protected]> --------- Co-authored-by: Tom Nicholas <[email protected]>
1 parent 737eb32 commit 206277f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

pyproject.toml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,11 @@ dev = [
113113
"pandas-stubs",
114114
"pooch",
115115
"pre-commit",
116-
"pytest-cov",
117-
"pytest-mypy",
118116
"pytest",
119117
"pytest-asyncio",
118+
"pytest-cov",
119+
"pytest-mypy",
120+
"pytest-xdist",
120121
"ruff",
121122
"s3fs",
122123
]
@@ -161,11 +162,11 @@ rust = "*"
161162
# Define commands to run within the test environments
162163
[tool.pixi.feature.dev.tasks]
163164
run-mypy = { cmd = "mypy virtualizarr" }
164-
run-tests = { cmd = "pytest --run-network-tests --verbose" }
165-
run-tests-no-network = { cmd = "pytest" }
166-
run-tests-cov = { cmd = "pytest --run-network-tests --verbose --cov=virtualizarr --cov=term-missing" }
167-
run-tests-xml-cov = { cmd = "pytest --run-network-tests --verbose --cov=virtualizarr --cov-report=xml" }
168-
run-tests-html-cov = { cmd = "pytest --run-network-tests --verbose --cov=virtualizarr --cov-report=html" }
165+
run-tests = { cmd = "pytest -n auto --run-network-tests --verbose" }
166+
run-tests-no-network = { cmd = "pytest -n auto" }
167+
run-tests-cov = { cmd = "pytest -n auto --run-network-tests --verbose --cov=virtualizarr --cov=term-missing" }
168+
run-tests-xml-cov = { cmd = "pytest -n auto --run-network-tests --verbose --cov=virtualizarr --cov-report=xml" }
169+
run-tests-html-cov = { cmd = "pytest -n auto --run-network-tests --verbose --cov=virtualizarr --cov-report=html" }
169170

170171
# Define which features and groups to include in different pixi (similar to conda) environments)
171172
[tool.pixi.environments]

0 commit comments

Comments
 (0)