Set up coverage.py. Refs #4.

This commit is contained in:
Jannis Leidel 2016-07-26 14:36:15 +02:00
parent 6578b59179
commit 864625d870
4 changed files with 20 additions and 12 deletions

6
.coveragerc Normal file
View file

@ -0,0 +1,6 @@
[run]
source = contextlib2
branch = 1
[report]
omit = *test*

1
.gitignore vendored
View file

@ -10,3 +10,4 @@ MANIFEST
*~
.coverage
coverage.xml
htmlcov/

View file

@ -17,6 +17,8 @@ matrix:
- python: pypy
env: TOXENV=pypy
install: pip install tox && tox --notest
install: pip install tox coveralls && tox --notest
script: tox
after_success: coveralls

21
tox.ini
View file

@ -1,18 +1,17 @@
[tox]
envlist = py26, py27, pypy, py33, py34, py35, py36, pypy3
envlist = py{26,27,33,34,35,36,py,py3}
skip_missing_interpreters = True
[testenv]
commands = {envpython} test_contextlib2.py
[testenv:py26]
deps = unittest2
[testenv:py27]
deps = unittest2
[testenv:pypy]
deps = unittest2
commands =
coverage erase
coverage run test_contextlib2.py
coverage report
deps =
coverage
py26: unittest2
py27: unittest2
pypy: unittest2
[testenv:pypy3]
# Known incompatibility: https://bitbucket.org/pypy/pypy/issues/1903