Skip to content

Commit

Permalink
Enable coverage reporting via codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Oct 30, 2018
1 parent 36e5b8b commit a72dce4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .coveragerc
@@ -0,0 +1,5 @@
[run]
branch = 1
# NOTE: cannot use package easily, without chdir (https://github.com/nedbat/coveragepy/issues/268).
source = paste/,tests/
parallel = 1
18 changes: 13 additions & 5 deletions .travis.yml
Expand Up @@ -7,14 +7,22 @@ script:
matrix:
include:
- python: 2.7
env: TOXENV=py27
env: TOXENV=py27-coverage
- python: 3.5
env: TOXENV=py35
env: TOXENV=py35-coverage
- python: 3.6
env: TOXENV=py36
env: TOXENV=py36-coverage
- python: 3.7
env: TOXENV=py37
env: TOXENV=py37-coverage
dist: xenial
sudo: true
- python: pypy
env: TOXENV=pypy
env: TOXENV=pypy-coverage

after_success:
- |
flags=${TOXENV%-coverage}
if [[ "$flags" != "$TOXENV" ]]; then
.tox/$TOXENV/bin/coverage xml
bash <(curl -s https://codecov.io/bash) -Z -X gcov -X search -X xcode -X fix -X coveragepy -f coverage.xml -F "$flags"
fi
7 changes: 6 additions & 1 deletion tox.ini
Expand Up @@ -2,8 +2,13 @@
envlist = py27, py35, py36, py37, pypy

[testenv]
# For performance, but also for using "source" with coveragepy (https://github.com/nedbat/coveragepy/issues/268).
usedevelop = True
deps =
pytest
pytest-cov
coverage: coverage
coverage: pytest-cov
setenv =
coverage: PYTEST_ADDOPTS=--cov --cov-report=term-missing
commands =
py.test {posargs}

0 comments on commit a72dce4

Please sign in to comment.