Skip to content

Commit

Permalink
Merge pull request twisted#48 from twisted/tox
Browse files Browse the repository at this point in the history
Run tests using tox.
  • Loading branch information
hawkowl committed Feb 16, 2016
2 parents d175004 + 06782c7 commit 11e29e2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 26 deletions.
39 changes: 13 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,26 @@ branches:
only:
- master

python:
- "2.7"
#- "pypy"

env:
- MODE=inplace
- MODE=sdist
- MODE=wheel
- TOXENV=py27-twlatest
- TOXENV=py27-twtrunk
- TOXENV=py27-tw14
# Test inplace on one variant
- TOXENV=py27-twlatest DEVELOP=--develop

matrix:
allow_failures:
- env: TOXENV=py27-twtrunk

install:
# Upgrade pip/setuptools
- pip install -U pip setuptools
# Tools for checking coverage and uploading to Codecov
- pip install coverage codecov
- |
python setup.py --version
if [ "${MODE}" == "inplace" ]; then
pip install --editable .
elif [ "${MODE}" == "sdist" ]; then
python setup.py sdist
pip install dist/Mantissa-"$(python setup.py --version)".tar.gz
elif [ "${MODE}" == "wheel" ]; then
pip install wheel
python setup.py bdist_wheel
pip install dist/Mantissa-"$(python setup.py --version)"-py2-none-any.whl
fi
- pip install -U pip setuptools wheel
- pip install tox codecov

script:
- cd /tmp && coverage run --branch --source=xmantissa $(type -p trial) xmantissa
- cd /tmp && coverage report -m
- tox ${DEVELOP}

after_success:
- cd "${TRAVIS_BUILD_DIR}" && mv /tmp/.coverage . && codecov
- mv .tox/.coverage . && codecov

notifications:
email: false
Expand Down
19 changes: 19 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[tox]
envlist={py27}-{twtrunk,twlatest,tw14}

[testenv]
# Remove this once the PyPy branch lands:
setenv =
PYTHONHASHSEED = 0
changedir={toxworkdir}
deps=
twlatest: Twisted
twtrunk: https://github.com/twisted/twisted/archive/trunk.zip
tw14: Twisted==14.0.0
coverage
commands=
pip list
coverage run {envdir}/bin/trial \
--temp-directory={envdir}/_trial_temp {posargs:xmantissa}
coverage report --rcfile={toxinidir}/.coveragerc
coverage html --rcfile={toxinidir}/.coveragerc --directory {envdir}/_coverage

0 comments on commit 11e29e2

Please sign in to comment.