diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..36509c0 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,7 @@ +[run] +branch = True +source = requests_mock +omit = requests_mock/tests/* + +[report] +ignore-errors = True diff --git a/.travis.yml b/.travis.yml index c36555e..2590715 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,10 @@ python: - "pypy" # command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors -install: pip install -r requirements.txt -r test-requirements.txt +install: pip install coverage coveralls -r requirements.txt -r test-requirements.txt # command to run tests, e.g. python setup.py test -script: python setup.py testr +script: coverage run -m testtools.run discover + +after_success: + coveralls diff --git a/README.rst b/README.rst index bffbe6b..b00d651 100644 --- a/README.rst +++ b/README.rst @@ -11,6 +11,8 @@ requests-mock .. image:: https://pypip.in/d/requests-mock/badge.png :target: https://crate.io/packages/requests-mock?version=latest +.. image:: https://coveralls.io/repos/jamielennox/requests-mock/badge.png + :target: https://coveralls.io/r/jamielennox/requests-mock Intro ----- diff --git a/tox.ini b/tox.ini index d7ec4ef..6cfca06 100644 --- a/tox.ini +++ b/tox.ini @@ -14,3 +14,12 @@ commands = flake8 requests_mock deps = flake8 {[testenv]deps} + +[testenv:coverage] +commands = + coverage erase + coverage run --source requests_mock -m testtools.run discover + coverage html +deps = + coverage + {[testenv]deps}