File tree Expand file tree Collapse file tree 5 files changed +29
-3
lines changed Expand file tree Collapse file tree 5 files changed +29
-3
lines changed 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:
58
58
- python3-dev
59
59
- python3-setuptools
60
60
- python : 3.6
61
- env : USE_WHEEL=1 RUN_FULL_TESTS=1
61
+ env : USE_WHEEL=1 RUN_FULL_TESTS=1 RUN_COVERAGE=1
62
62
- python : 2.7
63
63
env : USE_WHEEL=1 RUN_FULL_TESTS=1 PYTHON_OPTS="-3 -OO"
64
64
- python : 3.6
Original file line number Diff line number Diff line change 2
2
3
3
[ ![ Travis] ( https://img.shields.io/travis/numpy/numpy/master.svg?label=Travis%20CI )] ( https://travis-ci.org/numpy/numpy )
4
4
[ ![ 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 )
5
6
6
7
NumPy is the fundamental package needed for scientific computing with Python.
7
8
Original file line number Diff line number Diff line change 46
46
print ('NPY_RELAXED_STRIDES_CHECKING not set, but active.' )
47
47
sys .exit (1 )
48
48
49
+ if options .coverage :
50
+ # Produce code coverage XML report for codecov.io
51
+ args += ["--cov-report=xml" ]
52
+
49
53
result = numpy .test (options .mode ,
50
54
verbose = options .verbose ,
51
55
extra_argv = args ,
Original file line number Diff line number Diff line change @@ -105,6 +105,11 @@ run_test()
105
105
export PYTHONPATH=$PWD
106
106
fi
107
107
108
+ if [ -n " $RUN_COVERAGE " ]; then
109
+ pip install pytest-cov
110
+ COVERAGE_FLAG=--coverage
111
+ fi
112
+
108
113
# We change directories to make sure that python won't find the copy
109
114
# of numpy in the source directory.
110
115
mkdir -p empty
@@ -113,10 +118,17 @@ run_test()
113
118
" import os; import numpy; print(os.path.dirname(numpy.__file__))" )
114
119
export PYTHONWARNINGS=default
115
120
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
117
123
else
118
124
$PYTHON ../tools/test-installed-numpy.py -v
119
125
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
+
120
132
if [ -n " $USE_ASV " ]; then
121
133
pushd ../benchmarks
122
134
$PYTHON ` which asv` machine --machine travis
181
193
setup_base
182
194
run_test
183
195
fi
184
-
You can’t perform that action at this time.
0 commit comments