4545 - NPROC=2
4646 - TEST_ARGS=--no-pep8
4747 - NOSE_ARGS="--processes=$NPROC --process-timeout=300"
48+ - PYTEST_ARGS="-ra --timeout=300 --durations=25 --cov-report= --cov=lib" # -n $NPROC
4849 - PYTHON_ARGS=
4950 - 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
5055
5156matrix :
5257 include :
@@ -60,6 +65,8 @@ matrix:
6065 env : TEST_ARGS=--pep8
6166 - python : 3.5
6267 env : BUILD_DOCS=true
68+ - python : 3.5
69+ env : USE_PYTEST=true PANDAS=pandas DELETE_FONT_CACHE=1 TEST_ARGS=
6370 - python : " nightly"
6471 env : PRE=--pre
6572 - os : osx
@@ -107,10 +114,14 @@ install:
107114 # Install dependencies from pypi
108115 pip install $PRE python-dateutil $NUMPY pyparsing!=2.1.6 $PANDAS pep8 cycler coveralls coverage
109116 pip install $PRE pillow sphinx!=1.3.0 $MOCK numpydoc ipython colorspacious
117+
110118 # Install nose from a build which has partial
111119 # support for python36 and suport for coverage output suppressing
112120 pip install git+https://github.com/jenshnielsen/nose.git@matplotlibnose
113121
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+
114125 # We manually install humor sans using the package from Ubuntu 14.10. Unfortunatly humor sans is not
115126 # availible in the Ubuntu version used by Travis but we can manually install the deb from a later
116127 # version since is it basically just a .ttf file
@@ -147,16 +158,21 @@ script:
147158 - |
148159 echo Testing import of tkagg backend
149160 MPLBACKEND="tkagg" python -c 'import matplotlib.pyplot as plt; print(plt.get_backend())'
150- echo The following args are passed to nose $NOSE_ARGS
151161 if [[ $BUILD_DOCS == false ]]; then
152162 if [[ $DELETE_FONT_CACHE == 1 ]]; then
153163 rm -rf ~/.cache/matplotlib
154164 fi
155165 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
158173 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
160176 fi
161177 else
162178 cd doc
@@ -171,6 +187,9 @@ script:
171187 pip install $PRE requests==2.9.2 linkchecker
172188 linkchecker build/html/index.html
173189 fi
190+ # Currently disabled because of differece in behaviour
191+ # between `pytest-cov` and `nose-coverage`
192+ # - if [[ $USE_PYTEST == true ]]; then coveralls; fi
174193 - rm -rf $HOME/.cache/matplotlib/tex.cache
175194 - rm -rf $HOME/.cache/matplotlib/test_cache
176195
0 commit comments