Skip to content

Commit f8dad4c

Browse files
committed
feat: run pytest in parallel with pytest-xdist by default
- Add pytest-xdist to the dev group and regenerate uv.lock - Pass --numprocesses=auto through [tool.pytest] addopts so every pytest invocation, local or CI, distributes tests across all CPU cores
1 parent ba73416 commit f8dad4c

2 files changed

Lines changed: 33 additions & 2 deletions

File tree

‎template/pyproject.toml‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@ build-backend = "hatchling.build"
2222
packages = ["src/{{package_name}}"]
2323

2424
[dependency-groups]
25-
dev = ["prek>=0.5.2", "pytest>=9.1.1", "pytest-cov>=7.1.0", "ruff>=0.16.6", "ty>=0.0.78"]
25+
dev = [
26+
"prek>=0.5.2",
27+
"pytest>=9.1.1",
28+
"pytest-cov>=7.1.0",
29+
"pytest-xdist>=3.8.0",
30+
"ruff>=0.16.6",
31+
"ty>=0.0.78",
32+
]
2633

2734
[tool.ruff]
2835
line-length = 100
@@ -82,7 +89,7 @@ convention = "google"
8289

8390
[tool.pytest]
8491
testpaths = ["tests"]
85-
addopts = ["-ra", "--strict-markers", "--strict-config"]
92+
addopts = ["-ra", "--strict-markers", "--strict-config", "--numprocesses=auto"]
8693
xfail_strict = true
8794

8895
[tool.coverage.run]

‎template/uv.lock‎

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)