Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use diff-cover to show the change in coverage

  • Loading branch information...
commit 3cd6032b5c02c33ff95c80edd39c93973a24a735 1 parent c33fe50
@dstufft dstufft authored
Showing with 12 additions and 2 deletions.
  1. +1 −0  .gitignore
  2. +1 −1  .travis/install.sh
  3. +10 −1 .travis/run.sh
View
1  .gitignore
@@ -8,3 +8,4 @@ MANIFEST
*.py[cod]
*~
.coverage
+coverage.xml
View
2  .travis/install.sh
@@ -6,4 +6,4 @@ git config --global user.email "pypa-dev@googlegroups.com"
git config --global user.name "pip"
pip install --upgrade setuptools
-pip install tox
+pip install tox diff_cover
View
11 .travis/run.sh
@@ -7,7 +7,7 @@ set -x
export LC_CTYPE=en_US.UTF-8
# Run the unit tests
-tox -- -m unit
+tox -- -m unit --cov-report coverage.xml
# Run our integration tests, typically with pytest-xdist to speed things up
# except on Python 3.2 where it doesn't work quite right.
@@ -19,3 +19,12 @@ case $TOXENV in
tox -- -m integration -n 8
;;
esac
+
+
+# If this is a pull request then run our diff-cover to get the difference in
+# coverage that this PR introduces
+if [[ $TRAVIS_PULL_REQUEST != "false" ]]
+then
+ git fetch origin $TRAVIS_BRANCH:refs/remotes/origin/$TRAVIS_BRANCH
+ diff-cover --compare-branch=origin/$TRAVIS_BRANCH coverage.xml
+fi
Please sign in to comment.
Something went wrong with that request. Please try again.