8000 TST: Enable coveralls/codecov code coverage by jenshnielsen · Pull Request #4678 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

TST: Enable coveralls/codecov code coverage #4678

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

Merged
merged 14 commits into from
Nov 16, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
TST : enable coveralls
 - also update nose
  • Loading branch information
tacaswell authored and jenshnielsen committed Nov 15, 2015
commit e5cf5508242c9b1d2bfec19478e5cdfe3c2e02fc
10 changes: 10 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[run]
source=matplotlib
[report]
omit =
*/python?.?/*
*/site-packages/nose/*
*test*

exclude_lines =
raise NotImplemented
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ install:
pip install $PRE python-dateutil $NUMPY pyparsing!=2.0.4 pillow sphinx!=1.3.0;
fi
# Always install from pypi
- pip install $PRE pep8 cycler
- pip install $PRE pep8 cycler coveralls coverage
- 'pip install https://github.com/tacaswell/nose/zipball/mnt_py36_compat#egg=nose'

# We manually install humor sans using the package from Ubuntu 14.10. Unfortunatly humor sans is not
Expand Down Expand Up @@ -165,3 +165,4 @@ after_success:
fi
fi
fi
coveralls
8 changes: 6 additions & 2 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
def run(extra_args):
from nose.plugins import multiprocess

env = {"NOSE_WITH_COVERAGE": 1,
'NOSE_COVER_PACKAGE': 'matplotlib',
'NOSE_COVER_HTML': 1}
Copy link
Member

Choose a reason for hiding this comment

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

This should add to, not replace, os.environ.

Copy link
Member

Choose a reason for hiding this comment

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

Since code coverage can slow down runtimes, and it's not compatible with multiprocessing tests, we should probably have this be an option controlled by a commandline flag. Then on Travis-CI, we can do this just on one configuration (probably Python 3.5), and keep all the others running with multiple processes.


matplotlib._init_tests()

# Nose doesn't automatically instantiate all of the plugins in the
Expand All @@ -33,8 +37,8 @@ def run(extra_args):

nose.main(addplugins=[x() for x in plugins],
defaultTest=default_test_modules,
argv=sys.argv + extra_args)

argv=sys.argv + extra_args,
env=env)
Copy link
Member

Choose a reason for hiding this comment

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

This should also be done in lib/matplotlib/__init__.py:test. Probably move the definition of the environment variables to a private function in __init__.py and then get them from here and the test function.


if __name__ == '__main__':
extra_args = []
Expand Down
0