Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 17ae8c9

Browse files
committed
TST : enable coveralls
- also update nose
1 parent 57050f1 commit 17ae8c9

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

.coveragerc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[run]
2+
source=matplotlib
3+
[report]
4+
omit =
5+
*/python?.?/*
6+
*/site-packages/nose/*
7+
*test*
8+
9+
exclude_lines =
10+
raise NotImplemented

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ matrix:
4444
env: BUILD_DOCS=true
4545

4646
install:
47-
- pip install -q nose python-dateutil $NUMPY pep8 pyparsing pillow sphinx!=1.3.0
47+
- pip install python-dateutil $NUMPY pep8 pyparsing pillow sphinx!=1.3.0 coveralls coverage
48+
- pip install --upgrade nose
4849

4950
# We manually install humor sans using the package from Ubuntu 14.10. Unfortunatly humor sans is not
5051
# availible in the Ubuntu version used by Travis but we can manually install the deb from a later
@@ -142,3 +143,4 @@ after_success:
142143
fi
143144
fi
144145
fi
146+
coveralls

tests.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,20 @@
1919
import nose
2020
from matplotlib.testing.noseclasses import KnownFailure
2121
from matplotlib import default_test_modules
22-
22+
from nose.plugins.cover import Coverage
2323
from matplotlib import font_manager
2424
# Make sure the font caches are created before starting any possibly
2525
# parallel tests
2626
if font_manager._fmcache is not None:
2727
while not os.path.exists(font_manager._fmcache):
2828
time.sleep(0.5)
2929

30+
plugins = [KnownFailure, Coverage]
31+
3032
plugins = [KnownFailure]
33+
env = {"NOSE_WITH_COVERAGE": 1,
34+
'NOSE_COVER_PACKAGE': 'matplotlib',
35+
'NOSE_COVER_HTML': 1}
3136

3237
# Nose doesn't automatically instantiate all of the plugins in the
3338
# child processes, so we have to provide the multiprocess plugin with
@@ -45,7 +50,8 @@ def run():
4550
faulthandler.enable()
4651

4752
nose.main(addplugins=[x() for x in plugins],
48-
defaultTest=default_test_modules)
53+
defaultTest=default_test_modules,
54+
env=env)
4955

5056
if __name__ == '__main__':
5157
if '--no-pep8' in sys.argv:

0 commit comments

Comments
 (0)