From bef0dad525be3eeff14f94607a86a96519bdc777 Mon Sep 17 00:00:00 2001 From: Aron Griffis Date: Sat, 28 Nov 2015 22:23:48 -0500 Subject: [PATCH] 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. --- .coveragerc | 20 ++++++++++++++++++++ .travis.yml | 13 +++++++++++++ tox.ini | 4 ++-- 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 .coveragerc create mode 100644 .travis.yml diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..abe4775 --- /dev/null +++ b/.coveragerc @@ -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/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..a6354d5 --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/tox.ini b/tox.ini index 160e2a5..09f25a7 100644 --- a/tox.ini +++ b/tox.ini @@ -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