File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ codecov :
2+ ci :
3+ - !appveyor
4+ coverage :
5+ status :
6+ project :
7+ default :
8+ # Require 1% coverage, i.e., always succeed
9+ target : 1
10+ comment : off
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ matrix:
5858 - python3-dev
5959 - python3-setuptools
6060 - python : 3.6
61- env : USE_WHEEL=1 RUN_FULL_TESTS=1
61+ env : USE_WHEEL=1 RUN_FULL_TESTS=1 RUN_COVERAGE=1
6262 - python : 2.7
6363 env : USE_WHEEL=1 RUN_FULL_TESTS=1 PYTHON_OPTS="-3 -OO"
6464 - python : 3.6
Original file line number Diff line number Diff line change 22
33[ ![ Travis] ( https://img.shields.io/travis/numpy/numpy/master.svg?label=Travis%20CI )] ( https://travis-ci.org/numpy/numpy )
44[ ![ AppVeyor] ( https://img.shields.io/appveyor/ci/charris/numpy/master.svg?label=AppVeyor )] ( https://ci.appveyor.com/project/charris/numpy )
5+ [ ![ codecov] ( https://codecov.io/gh/numpy/numpy/branch/master/graph/badge.svg )] ( https://codecov.io/gh/numpy/numpy )
56
67NumPy is the fundamental package needed for scientific computing with Python.
78
Original file line number Diff line number Diff line change 4646 print ('NPY_RELAXED_STRIDES_CHECKING not set, but active.' )
4747 sys .exit (1 )
4848
49+ if options .coverage :
50+ # Produce code coverage XML report for codecov.io
51+ args += ["--cov-report=xml" ]
52+
4953result = numpy .test (options .mode ,
5054 verbose = options .verbose ,
5155 extra_argv = args ,
Original file line number Diff line number Diff line change @@ -105,6 +105,11 @@ run_test()
105105 export PYTHONPATH=$PWD
106106 fi
107107
108+ if [ -n " $RUN_COVERAGE " ]; then
109+ pip install pytest-cov
110+ COVERAGE_FLAG=--coverage
111+ fi
112+
108113 # We change directories to make sure that python won't find the copy
109114 # of numpy in the source directory.
110115 mkdir -p empty
@@ -113,10 +118,17 @@ run_test()
113118 " import os; import numpy; print(os.path.dirname(numpy.__file__))" )
114119 export PYTHONWARNINGS=default
115120 if [ -n " $RUN_FULL_TESTS " ]; then
116- $PYTHON ../tools/test-installed-numpy.py -v --mode=full
121+ export PYTHONWARNINGS=" ignore::DeprecationWarning:virtualenv"
122+ $PYTHON ../tools/test-installed-numpy.py -v --mode=full $COVERAGE_FLAG
117123 else
118124 $PYTHON ../tools/test-installed-numpy.py -v
119125 fi
126+
127+ if [ -n " $RUN_COVERAGE " ]; then
128+ # Upload coverage files to codecov
129+ bash <( curl -s https://codecov.io/bash) -X gcov -X coveragepy
130+ fi
131+
120132 if [ -n " $USE_ASV " ]; then
121133 pushd ../benchmarks
122134 $PYTHON ` which asv` machine --machine travis
181193 setup_base
182194 run_test
183195fi
184-
You can’t perform that action at this time.
0 commit comments