Add support for travis and coveralls.

This works by running tox inside travis, rather than duplicating the tox
config in travis syntax. The big win here is that coverage collects across
all the Python versions and then submits the combined result to coveralls.
This commit is contained in:
Aron Griffis
2015-11-28 22:23:48 -05:00
parent f7723f5ac4
commit bef0dad525
3 changed files with 35 additions and 2 deletions

20
.coveragerc Normal file
View File

@@ -0,0 +1,20 @@
[run]
# Measure coverage of both tests and wrapt module.
source =
tests
wrapt
# This doesn't run the tests in parallel, it just causes the output to land
# in uniquely-named .coverage.* files to be combined at the end of running
# tox over the matrix.
parallel = true
[paths]
# For the coverage combine command, consider these paths equivalent with
# the first one being primary.
src =
src/
.tox/*/lib/*/site-packages/
.tox/pypy*/site-packages/

13
.travis.yml Normal file
View File

@@ -0,0 +1,13 @@
language: python
python: 2.7
env:
global:
- COVERAGE_CMD="coverage run -m"
- COVERAGE_DEP=coverage
install:
- pip install tox coveralls
script:
- tox
after_script:
- coverage combine
- coveralls

View File

@@ -14,10 +14,10 @@ envlist =
[testenv]
deps =
{env:COVERAGE_DEP:}
pytest
pytest-cov
commands =
py.test -v --cov wrapt --cov-report html []
{env:COVERAGE_CMD:} py.test -v []
[pytest]
norecursedirs = .tox venv