Test all supported pytest versions (plus more python interpreters) (#265)

Test all supported pytest versions (plus more python interpreters) and pytest-xdist
This commit is contained in:
Alessio Bogon 2018-11-02 12:11:47 +01:00 committed by GitHub
parent f7a30fc843
commit f1a3e45e51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 57 additions and 38 deletions

View File

@ -1,17 +1,39 @@
sudo: false sudo: false
language: python language: python
python: "3.4" python: "2.7"
env:
matrix: matrix:
- TESTENV=linters include:
- TESTENV=py27 - env: TOXENV=py27-pytestlatest-linters
# - TESTENV=py27-xdist - env: TOXENV=py27-pytest29
- TESTENV=py27-pytest-latest - env: TOXENV=py27-pytest30
- TESTENV=py34 - env: TOXENV=py27-pytest31
- TESTENV=coveralls - env: TOXENV=py27-pytest32
- env: TOXENV=py27-pytest33
- env: TOXENV=py27-pytest34
- env: TOXENV=py27-pytest35
- env: TOXENV=py27-pytest36
- env: TOXENV=py27-pytest37
- env: TOXENV=py27-pytest38
- env: TOXENV=py27-pytest39
- env: TOXENV=py27-pytestlatest
- env: TOXENV=py27-pytestlatest-xdist
- env: TOXENV=py34-pytestlatest
python: "3.4"
- env: TOXENV=py35-pytestlatest
python: "3.5"
- env: TOXENV=py36-pytestlatest
python: "3.6"
- env: TOXENV=py37-pytestlatest
python: "3.7"
# Currently, python 3.7 is a little bit tricky to install:
# https://github.com/travis-ci/travis-ci/issues/9069#issuecomment-425720905
sudo: required
dist: xenial
- env: TOXENV=py27-pytestlatest-coveralls
install: install:
- pip install tox - pip install tox
script: tox -e $TESTENV --recreate script: tox --recreate
branches: branches:
except: except:
- /^\d/ - /^\d/

View File

@ -2,4 +2,3 @@ mock
pytest-pep8 pytest-pep8
coverage<4.0a1 coverage<4.0a1
pytest-cache pytest-cache
pytest-xdist

46
tox.ini
View File

@ -1,38 +1,36 @@
[tox] [tox]
distshare={homedir}/.tox/distshare distshare={homedir}/.tox/distshare
#envlist=linters,py27,py27-xdist,py27-pytest-latest,py34 envlist=py27-pytestlatest-linters,py27-pytest{29,30,31,32,33,34,35,36,37,38,39,latest},py{34,35,36,37}-pytestlatest,py27-pytestlatest-xdist
envlist=linters,py27,py27-pytest-minimal,py27-pytest-latest,py34
skip_missing_interpreters = true skip_missing_interpreters = true
[testenv] [testenv]
deps =
pytestlatest: pytest
pytest39: pytest~=3.9.0
pytest38: pytest~=3.8.0
pytest37: pytest~=3.7.0
pytest36: pytest~=3.6.0
pytest35: pytest~=3.5.0
pytest34: pytest~=3.4.0
pytest33: pytest~=3.3.0
pytest32: pytest~=3.2.0
pytest31: pytest~=3.1.0
pytest30: pytest~=3.0.0
pytest29: pytest~=2.9.0
pytest30,pytest29: pytest-warnings
-r{toxinidir}/requirements-testing.txt
commands = py.test tests --junitxml={envlogdir}/junit-{envname}.xml commands = py.test tests --junitxml={envlogdir}/junit-{envname}.xml
deps = -r{toxinidir}/requirements-testing.txt
[testenv:linters] [testenv:py27-pytestlatest-linters]
interpreter=python2.7
commands={[testenv]commands} pytest_bdd --pep8 -m pep8 commands={[testenv]commands} pytest_bdd --pep8 -m pep8
[testenv:py27-xdist] [testenv:py27-pytestlatest-xdist]
basepython=python2.7
commands=
py.test pytest_bdd tests -n3 --pep8 -rfsxX \
--junitxml={envlogdir}/junit-{envname}.xml
[testenv:py27-pytest-latest]
basepython=python2.7
deps = deps =
pytest-xdist
{[testenv]deps} {[testenv]deps}
git+https://github.com/pytest-dev/py#egg=py commands={[testenv]commands} -n3 -rfsxX
git+https://github.com/pytest-dev/pytest.git@features#egg=pytest
[testenv:py27-pytest-minimal] [testenv:py27-pytestlatest-coveralls]
basepython=python2.7
deps =
pytest==2.9.0
pytest-xdist==1.17
mock
[testenv:coveralls]
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
usedevelop = True usedevelop = True
changedir = . changedir = .
@ -40,7 +38,7 @@ deps =
{[testenv]deps} {[testenv]deps}
coveralls coveralls
commands= commands=
coverage run --source=pytest_bdd {envdir}/bin/py.test tests coverage run --branch --source=pytest_bdd {envbindir}/pytest tests
coverage report -m coverage report -m
coveralls coveralls