Add psutil extra and introduce pytest_xdist_auto_num_workers hook

This makes using psutil optional and opens up the possibility of customization
through the pytest_xdist_auto_num_workers hook, making things like #477 possible.

Fix #585
This commit is contained in:
Bruno Oliveira
2020-08-24 15:17:43 -03:00
parent e469fc7b80
commit 607d8288d4
10 changed files with 88 additions and 21 deletions

16
tox.ini
View File

@@ -3,9 +3,9 @@ envlist=
linting
py{35,36,37,38,39}-pytestlatest
py38-pytestmaster
py38-psutil
[testenv]
passenv = USER USERNAME
extras = testing
deps =
pytestlatest: pytest
@@ -13,8 +13,16 @@ deps =
commands=
pytest {posargs}
[testenv:py38-psutil]
extras =
testing
psutil
deps = pytest
commands =
pytest {posargs:-k psutil}
[testenv:linting]
skipsdist = True
skip_install = True
usedevelop = True
deps =
pre-commit
@@ -28,9 +36,9 @@ skipsdist = True
usedevelop = True
passenv = *
deps =
towncrier
towncrier
commands =
towncrier --version {posargs} --yes
towncrier --version {posargs} --yes
[pytest]
addopts = -ra