Skip to content

Commit 20ff9e5

Browse files
committed
BF: fix broken coverage runs in virtualenv
Now we're running in our own virtualenv, coverage was trying to cover everything we imported. I have no idea why that is, but futzing on a VM similar to the travis machines seemed to recover the right behavior.
1 parent 1ca2da4 commit 20ff9e5

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

.coveragerc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ branch = True
33
source = nibabel, nisext
44
include = */nibabel/*, */nisext/*
55
omit =
6-
nibabel/externals/*
7-
nibabel/benchmarks/*
8-
nisext/ast.py
9-
nisext/codegen.py
6+
*/externals/*
7+
*/benchmarks/*
8+
*/ast.py
9+
*/codegen.py

.travis.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ matrix:
1717
include:
1818
- python: 2.7
1919
env:
20-
- COVERAGE=--with-coverage
20+
- COVERAGE=1
2121
# Absolute minimum dependencies
2222
- python: 2.7
2323
env:
@@ -37,7 +37,7 @@ before_install:
3737
pip install pydicom;
3838
fi
3939
fi
40-
- if [ "${COVERAGE}" == "--with-coverage" ]; then
40+
- if [ "${COVERAGE}" == "1" ]; then
4141
pip install coverage;
4242
pip install coveralls;
4343
fi
@@ -51,7 +51,10 @@ script:
5151
# Change into an innocuous directory and find tests from installation
5252
- mkdir for_testing
5353
- cd for_testing
54-
- if [ "${COVERAGE}" == "--with-coverage" ]; then cp ../.coveragerc .; fi
55-
- nosetests --with-doctest $COVERAGE `python -c "import os; import nibabel; print(os.path.dirname(nibabel.__file__))"`
54+
- if [ "${COVERAGE}" == "1" ]; then
55+
cp ../.coveragerc .;
56+
COVER_ARGS="--with-coverage --cover-package nibabel";
57+
fi
58+
- nosetests --with-doctest $COVER_ARGS nibabel
5659
after_success:
57-
- if [ "${COVERAGE}" == "--with-coverage" ]; then coveralls; fi
60+
- if [ "${COVERAGE}" == "1" ]; then coveralls; fi

0 commit comments

Comments
 (0)