Skip to content

Commit

Permalink
Run tests in parallel with pytest-xdist
Browse files Browse the repository at this point in the history
Also stop running tox in parallel when not required because it buffers
output, making it harder to see what is happening.

Output could be shown unbuffered with --parallel-live but it isn't
really helpful for what we're trying to achieve.
  • Loading branch information
sbraz committed Nov 13, 2020
1 parent 733b4d1 commit 821273f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
38 changes: 23 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,45 @@ addons:
jobs:
include:
- python: &python_main_version 3.8
env: TOXENV=docs,black,flake8,isort,mypy,pylint
env:
TOXENV: docs,black,flake8,isort,mypy,pylint
TOX_PARALLEL: "-p"
- python: 3.6
env: TOXENV=py36
env:
TOXENV: py36
- python: 3.7
env: TOXENV=py37
env:
TOXENV: py37
- python: 3.8
env: TOXENV=py38
env:
TOXENV: py38
- python: 3.9
env: TOXENV=py39
env:
TOXENV: py39
- python: pypy3
env: TOXENV=pypy3
env:
TOXENV: pypy3
- os: osx
# Not required but makes Travis' output prettier
language: generic
env:
- MB_PYTHON_VERSION=3.6
- TOXENV=py36
MB_PYTHON_VERSION: 3.6
TOXENV: py36
- os: osx
language: generic
env:
- MB_PYTHON_VERSION=3.7
- TOXENV=py37
MB_PYTHON_VERSION: 3.7
TOXENV: py37
- os: osx
language: generic
env:
- MB_PYTHON_VERSION=3.8
- TOXENV=py38
MB_PYTHON_VERSION: 3.8
TOXENV: py38
- os: osx
language: generic
env:
- MB_PYTHON_VERSION=3.9
- TOXENV=py39
MB_PYTHON_VERSION: 3.9
TOXENV: py39
before_install: |
if [ $TRAVIS_OS_NAME == osx ]; then
git clone https://github.com/matthew-brett/multibuild
Expand All @@ -62,7 +69,7 @@ before_install: |
popd
fi
pip install tox
script: tox -p
script: "tox $TOX_PARALLEL"
notifications:
email:
on_success: change
Expand All @@ -89,3 +96,4 @@ env:
- LIBZEN_VERSION: 0.4.38
- UBUNTU_VERSION: 18.04
- PYTHON_MAIN_VERSION: *python_main_version
- TOX_PARALLEL_NO_SPINNER: 1
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ install:
- "move MediaInfo.dll pymediainfo"
- "move Developers\\License.html docs"
# TODO: remove the constraint when https://github.com/tox-dev/tox/issues/1550 is fixed
- "pip install --upgrade setuptools pytest tox==3.8.3 twine wheel"
- "pip install --upgrade setuptools tox==3.8.3 twine wheel"
build_script:
- "python setup.py bdist_wheel"
test_script:
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ envlist =
[testenv]
deps =
pytest
pytest-xdist
setuptools_scm
commands =
pytest {posargs}
pytest -n auto {posargs}

[testenv:docs]
deps = sphinx
Expand Down

0 comments on commit 821273f

Please sign in to comment.