Skip to content

Commit 1aabdc9

Browse files
committed
Add tox.ini to easily test across multiple environments
Using tox makes it quick and easy to test all supported environments with a single command, `tox`. It also makes it very simple to recreate the same test environments as used on Travis CI. For details on tox, see: https://tox.readthedocs.io/
1 parent af02ef6 commit 1aabdc9

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

.travis.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,20 @@ cache: pip
55
matrix:
66
include:
77
- python: 2.7
8+
env: TOXENV=py27
89
- python: 3.4
10+
env: TOXENV=py34
911
- python: 3.5
12+
env: TOXENV=py35
1013
- python: 3.6
14+
env: TOXENV=py36
1115
- python: 3.7
16+
env: TOXENV=py37
1217
dist: xenial # required for Python 3.7 (travis-ci/travis-ci#9069)
1318
sudo: required # required for Python 3.7 (travis-ci/travis-ci#9069)
1419

1520
install:
16-
- python setup.py install
21+
- pip install tox
1722

1823
before_script:
1924
# Run flake8 tests only on Python 2.7 and 3.7...
@@ -28,7 +33,4 @@ before_script:
2833
# command to run tests, e.g. python setup.py test
2934

3035
script:
31-
# We might like to get out of the source directory before running tests to
32-
# avoid PYTHONPATH confusion? As an example, see here:
33-
# https://github.com/tornadoweb/tornado/blob/master/.travis.yml
34-
- python setup.py test
36+
- tox

tox.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[tox]
2+
envlist = py27,py34,py35,py36,py37
3+
4+
[testenv]
5+
commands = python setup.py test

0 commit comments

Comments
 (0)