Skip to content

Commit 7bee359

Browse files
committed
tox: add generic xdist factor
1 parent ed01dc6 commit 7bee359

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

tox.ini

+4-17
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,21 @@ envlist =
2020

2121
[testenv]
2222
commands =
23-
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest --lsof {posargs}
23+
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest {env:_PYTEST_TOX_ARGS:} {posargs}
2424
coverage: coverage combine
2525
coverage: coverage report
2626
passenv = USER USERNAME COVERAGE_* TRAVIS
2727
setenv =
28+
_PYTEST_TOX_ARGS=--lsof
2829
# configuration if a user runs tox with a "coverage" factor, for example "tox -e py37-coverage"
2930
coverage: _PYTEST_TOX_COVERAGE_RUN=coverage run -m
3031
coverage: _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess
3132
coverage: COVERAGE_FILE={toxinidir}/.coverage
3233
coverage: COVERAGE_PROCESS_START={toxinidir}/.coveragerc
34+
xdist: _PYTEST_TOX_ARGS={env:_PYTEST_TOX_ARGS:-n auto}
3335
extras = testing
3436
deps =
37+
xdist: pytest-xdist>=1.13
3538
{env:_PYTEST_TOX_EXTRA_DEP:}
3639

3740
[testenv:py27-subprocess]
@@ -49,22 +52,6 @@ basepython = python3
4952
deps = pre-commit>=1.11.0
5053
commands = pre-commit run --all-files --show-diff-on-failure
5154

52-
[testenv:py27-xdist]
53-
extras = testing
54-
deps =
55-
pytest-xdist>=1.13
56-
{env:_PYTEST_TOX_EXTRA_DEP:}
57-
commands =
58-
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest -n auto {posargs}
59-
60-
[testenv:py37-xdist]
61-
# NOTE: copied from above due to https://github.com/tox-dev/tox/issues/706.
62-
extras = testing
63-
deps =
64-
pytest-xdist>=1.13
65-
{env:_PYTEST_TOX_EXTRA_DEP:}
66-
commands = {[testenv:py27-xdist]commands}
67-
6855
[testenv:py27-pexpect]
6956
platform = linux|darwin
7057
deps =

0 commit comments

Comments
 (0)