diff --git a/.travis.yml b/.travis.yml index 5455b1f..524b67c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/IPython/testing/iptestcontroller.py b/IPython/testing/iptestcontroller.py index 81da35f..e41d86c 100644 --- a/IPython/testing/iptestcontroller.py +++ b/IPython/testing/iptestcontroller.py @@ -636,7 +636,7 @@ def run_iptestall(options): print() if options.coverage: - from coverage import coverage + from coverage import coverage, CoverageException cov = coverage(data_file='.coverage') cov.combine() cov.save() @@ -671,7 +671,12 @@ def run_iptestall(options): # 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