Skip to content

Commit f1a3e45

Browse files
authored
Test all supported pytest versions (plus more python interpreters) (#265)
Test all supported pytest versions (plus more python interpreters) and pytest-xdist
1 parent f7a30fc commit f1a3e45

File tree

3 files changed

+57
-38
lines changed

3 files changed

+57
-38
lines changed

.travis.yml

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,39 @@
11
sudo: false
22
language: python
3-
python: "3.4"
4-
env:
5-
matrix:
6-
- TESTENV=linters
7-
- TESTENV=py27
8-
# - TESTENV=py27-xdist
9-
- TESTENV=py27-pytest-latest
10-
- TESTENV=py34
11-
- TESTENV=coveralls
3+
python: "2.7"
4+
5+
matrix:
6+
include:
7+
- env: TOXENV=py27-pytestlatest-linters
8+
- env: TOXENV=py27-pytest29
9+
- env: TOXENV=py27-pytest30
10+
- env: TOXENV=py27-pytest31
11+
- env: TOXENV=py27-pytest32
12+
- env: TOXENV=py27-pytest33
13+
- env: TOXENV=py27-pytest34
14+
- env: TOXENV=py27-pytest35
15+
- env: TOXENV=py27-pytest36
16+
- env: TOXENV=py27-pytest37
17+
- env: TOXENV=py27-pytest38
18+
- env: TOXENV=py27-pytest39
19+
- env: TOXENV=py27-pytestlatest
20+
- env: TOXENV=py27-pytestlatest-xdist
21+
- env: TOXENV=py34-pytestlatest
22+
python: "3.4"
23+
- env: TOXENV=py35-pytestlatest
24+
python: "3.5"
25+
- env: TOXENV=py36-pytestlatest
26+
python: "3.6"
27+
- env: TOXENV=py37-pytestlatest
28+
python: "3.7"
29+
# Currently, python 3.7 is a little bit tricky to install:
30+
# https://github.com/travis-ci/travis-ci/issues/9069#issuecomment-425720905
31+
sudo: required
32+
dist: xenial
33+
- env: TOXENV=py27-pytestlatest-coveralls
1234
install:
1335
- pip install tox
14-
script: tox -e $TESTENV --recreate
36+
script: tox --recreate
1537
branches:
1638
except:
1739
- /^\d/

requirements-testing.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ mock
22
pytest-pep8
33
coverage<4.0a1
44
pytest-cache
5-
pytest-xdist

tox.ini

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,44 @@
11
[tox]
22
distshare={homedir}/.tox/distshare
3-
#envlist=linters,py27,py27-xdist,py27-pytest-latest,py34
4-
envlist=linters,py27,py27-pytest-minimal,py27-pytest-latest,py34
3+
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
54
skip_missing_interpreters = true
65

76
[testenv]
8-
commands= py.test tests --junitxml={envlogdir}/junit-{envname}.xml
9-
deps = -r{toxinidir}/requirements-testing.txt
7+
deps =
8+
pytestlatest: pytest
9+
pytest39: pytest~=3.9.0
10+
pytest38: pytest~=3.8.0
11+
pytest37: pytest~=3.7.0
12+
pytest36: pytest~=3.6.0
13+
pytest35: pytest~=3.5.0
14+
pytest34: pytest~=3.4.0
15+
pytest33: pytest~=3.3.0
16+
pytest32: pytest~=3.2.0
17+
pytest31: pytest~=3.1.0
18+
pytest30: pytest~=3.0.0
19+
pytest29: pytest~=2.9.0
20+
pytest30,pytest29: pytest-warnings
21+
-r{toxinidir}/requirements-testing.txt
22+
commands = py.test tests --junitxml={envlogdir}/junit-{envname}.xml
1023

11-
[testenv:linters]
12-
interpreter=python2.7
24+
[testenv:py27-pytestlatest-linters]
1325
commands={[testenv]commands} pytest_bdd --pep8 -m pep8
1426

15-
[testenv:py27-xdist]
16-
basepython=python2.7
17-
commands=
18-
py.test pytest_bdd tests -n3 --pep8 -rfsxX \
19-
--junitxml={envlogdir}/junit-{envname}.xml
20-
21-
[testenv:py27-pytest-latest]
22-
basepython=python2.7
27+
[testenv:py27-pytestlatest-xdist]
2328
deps =
29+
pytest-xdist
2430
{[testenv]deps}
25-
git+https://github.com/pytest-dev/py#egg=py
26-
git+https://github.com/pytest-dev/pytest.git@features#egg=pytest
27-
28-
[testenv:py27-pytest-minimal]
29-
basepython=python2.7
30-
deps =
31-
pytest==2.9.0
32-
pytest-xdist==1.17
33-
mock
31+
commands={[testenv]commands} -n3 -rfsxX
3432

35-
[testenv:coveralls]
33+
[testenv:py27-pytestlatest-coveralls]
3634
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
37-
usedevelop=True
38-
changedir=.
35+
usedevelop = True
36+
changedir = .
3937
deps =
4038
{[testenv]deps}
4139
coveralls
4240
commands=
43-
coverage run --source=pytest_bdd {envdir}/bin/py.test tests
41+
coverage run --branch --source=pytest_bdd {envbindir}/pytest tests
4442
coverage report -m
4543
coveralls
4644

0 commit comments

Comments
 (0)