45
45
- NPROC=2
46
46
- TEST_ARGS=--no-pep8
47
47
- NOSE_ARGS="--processes=$NPROC --process-timeout=300"
48
+ - PYTEST_ARGS="-ra --timeout=300 --durations=25 --cov-report= --cov=lib" # -n $NPROC
48
49
- PYTHON_ARGS=
49
50
- DELETE_FONT_CACHE=
51
+ - USE_PYTEST=false
52
+ # - PYTHONHASHSEED=0 # Workaround for pytest-xdist flaky colletion order
53
+ # # https://github.com/pytest-dev/pytest/issues/920
54
+ # # https://github.com/pytest-dev/pytest/issues/1075
50
55
51
56
matrix :
52
57
include :
@@ -60,6 +65,8 @@ matrix:
60
65
env : TEST_ARGS=--pep8
61
66
- python : 3.5
62
67
env : BUILD_DOCS=true
68
+ - python : 3.5
69
+ env : USE_PYTEST=true PANDAS=pandas DELETE_FONT_CACHE=1 TEST_ARGS=
63
70
- python : " nightly"
64
71
env : PRE=--pre
65
72
- os : osx
@@ -107,10 +114,14 @@ install:
107
114
# Install dependencies from pypi
108
115
pip install $PRE python-dateutil $NUMPY pyparsing!=2.1.6 $PANDAS pep8 cycler coveralls coverage
109
116
pip install $PRE pillow sphinx!=1.3.0 $MOCK numpydoc ipython colorspacious
117
+
110
118
# Install nose from a build which has partial
111
119
# support for python36 and suport for coverage output suppressing
112
120
pip install git+https://github.com/jenshnielsen/nose.git@matplotlibnose
113
121
122
+ # pytest-cov>=2.3.1 due to https://github.com/pytest-dev/pytest-cov/issues/124
123
+ pip install $PRE pytest 'pytest-cov>=2.3.1' pytest-timeout pytest-xdist pytest-faulthandler
124
+
114
125
# We manually install humor sans using the package from Ubuntu 14.10. Unfortunatly humor sans is not
115
126
# availible in the Ubuntu version used by Travis but we can manually install the deb from a later
116
127
# version since is it basically just a .ttf file
@@ -147,16 +158,21 @@ script:
147
158
- |
148
159
echo Testing import of tkagg backend
149
160
MPLBACKEND="tkagg" python -c 'import matplotlib.pyplot as plt; print(plt.get_backend())'
150
- echo The following args are passed to nose $NOSE_ARGS
151
161
if [[ $BUILD_DOCS == false ]]; then
152
162
if [[ $DELETE_FONT_CACHE == 1 ]]; then
153
163
rm -rf ~/.cache/matplotlib
154
164
fi
155
165
export MPL_REPO_DIR=$PWD # needed for pep8-conformance test of the examples
156
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
157
- python tests.py $NOSE_ARGS $TEST_ARGS
166
+ if [[ $USE_PYTEST == false ]]; then
167
+ echo The following args are passed to nose $NOSE_ARGS
168
+ if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
169
+ python tests.py $NOSE_ARGS $TEST_ARGS
170
+ else
171
+ gdb -return-child-result -batch -ex r -ex bt --args python $PYTHON_ARGS tests.py $NOSE_ARGS $TEST_ARGS
172
+ fi
158
173
else
159
- gdb -return-child-result -batch -ex r -ex bt --args python $PYTHON_ARGS tests.py $NOSE_ARGS $TEST_ARGS
174
+ echo The following args are passed to pytest $PYTEST_ARGS
175
+ py.test $PYTEST_ARGS $TEST_ARGS
160
176
fi
161
177
else
162
178
cd doc
@@ -171,6 +187,9 @@ script:
171
187
pip install $PRE requests==2.9.2 linkchecker
172
188
linkchecker build/html/index.html
173
189
fi
190
+ # Currently disabled because of differece in behaviour
191
+ # between `pytest-cov` and `nose-coverage`
192
+ # - if [[ $USE_PYTEST == true ]]; then coveralls; fi
174
193
- rm -rf $HOME/.cache/matplotlib/tex.cache
175
194
- rm -rf $HOME/.cache/matplotlib/test_cache
176
195
0 commit comments