Skip to content

Commit

Permalink
Merge pull request #7215 from Carreau/coveralls
Browse files Browse the repository at this point in the history
enable test coverage on coveralls
  • Loading branch information
minrk committed Jan 6, 2015
2 parents 4841098 + 068a99d commit 12277c7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ before_install:
- git clone --quiet --depth 1 https://github.com/minrk/travis-wheels travis-wheels
- 'if [[ $GROUP == js* ]]; then python -m IPython.external.mathjax; fi'
install:
- pip install coveralls
- pip install -f travis-wheels/wheelhouse file://$PWD#egg=ipython[all]
script:
- cd /tmp && iptest $GROUP
- cd /tmp && iptest $GROUP --coverage xml && cd -

matrix:
exclude:
- python: 3.3
env: GROUP=js

after_success:
- cp /tmp/ipy_coverage.xml ./
- cp /tmp/.coverage ./
- coveralls
9 changes: 7 additions & 2 deletions IPython/testing/iptestcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ def justify(ltext, rtext, width=70, fill='-'):
print()

if options.coverage:
from coverage import coverage
from coverage import coverage, CoverageException
cov = coverage(data_file='.coverage')
cov.combine()
cov.save()
Expand Down Expand Up @@ -671,7 +671,12 @@ def find_code_units(self, morfs):

# Coverage XML report
elif options.coverage == 'xml':
cov.xml_report(outfile='ipy_coverage.xml')
try:
cov.xml_report(outfile='ipy_coverage.xml')
except CoverageException as e:
print('Generating coverage report failed. Are you running javascript tests only?')
import traceback
traceback.print_exc()

if failed:
# Ensure that our exit code indicates failure
Expand Down

0 comments on commit 12277c7

Please sign in to comment.