Skip to content

Commit f237961

Browse files
committed
✨ feat(tox): add support for pytest-xdist in Tox
1 parent 9711e7e commit f237961

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

template/pyproject.toml.jinja

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ Documentation = "{{ documentation }}"
5151
dev = [
5252
"pytest>=8.3.5",
5353
"pytest-cov>=6.1.1",
54+
{%- if pytest_xdist %}
55+
"pytest-xdist>=3.6.1",
56+
{%- endif %}
5457
"pre-commit>=4.2.0",
5558
{%- if tox %}
5659
"tox-uv>=1.25.0",

template/{% if tox %}tox.ini{% endif %}.jinja

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ python =
2424
[testenv]
2525
passenv = PYTHON_VERSION
2626
allowlist_externals = uv
27+
setenv =
28+
COVERAGE_FILE = .coverage.{envname}
2729
commands =
2830
uv sync --python {envpython} --active
29-
uv run --python {envpython} --active python -m pytest --doctest-modules tests --cov --cov-config=pyproject.toml --cov-report=xml --cov-report=term-missing -vv
31+
uv run --python {envpython} --active python -m pytest --doctest-modules tests --cov --cov-config=pyproject.toml -vv{% if pytest_xdist %} -n auto{% endif %}
3032
uv run --python {envpython} --active mypy

0 commit comments

Comments
 (0)