Skip to content

TST : enable coveralls #4367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[run]
source=matplotlib
[report]
omit =
matplotlib/tests/*
matplotlib/testing/*

exclude_lines =
raise NotImplemented
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,10 @@ examples/tests/*
texput.log
texput.aux
result_images

# Coverage generated files #
############################

.coverage
.coverage.*
cover/
12 changes: 10 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ matrix:
env: BUILD_DOCS=true

install:
- pip install -q nose python-dateutil $NUMPY pep8 pyparsing pillow sphinx!=1.3.0
- pip install python-dateutil $NUMPY pep8 pyparsing pillow sphinx!=1.3.0 coveralls coverage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On purpose that nose is dropped here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, nose is installed by default on travis, I was looking for version conflict issues (there were a whole bunch of force-pushed attempts at this).

- pip install --upgrade nose

# We manually install humor sans using the package from Ubuntu 14.10. Unfortunatly humor sans is not
# availible in the Ubuntu version used by Travis but we can manually install the deb from a later
Expand All @@ -66,7 +67,7 @@ install:
cp Felipa-Regular.ttf ~/.fonts
fc-cache -f -v
fi;
- python setup.py install
- python setup.py install --single-version-externally-managed --record=/dev/null

script:
# The number of processes is hardcoded, because using too many causes the
Expand Down Expand Up @@ -142,3 +143,10 @@ after_success:
fi
fi
fi
if [[ $BUILD_DOCS == false && $TEST_ARGS != "--pep8" ]]; then
# account for us running the test out-of-repo and coveralls expects in-repo
# tests
mv cover .coverage ../matplotlib
cd ../matplotlib
coveralls
fi
10 changes: 8 additions & 2 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,20 @@
import nose
from matplotlib.testing.noseclasses import KnownFailure
from matplotlib import default_test_modules

from nose.plugins.cover import Coverage
from matplotlib import font_manager
# Make sure the font caches are created before starting any possibly
# parallel tests
if font_manager._fmcache is not None:
while not os.path.exists(font_manager._fmcache):
time.sleep(0.5)

plugins = [KnownFailure, Coverage]

plugins = [KnownFailure]
env = {"NOSE_WITH_COVERAGE": 1,
'NOSE_COVER_PACKAGE': 'matplotlib',
'NOSE_COVER_HTML': 1}

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

nose.main(addplugins=[x() for x in plugins],
defaultTest=default_test_modules)
defaultTest=default_test_modules,
env=env)

if __name__ == '__main__':
if '--no-pep8' in sys.argv:
Expand Down