From 7f68c8a6a38049284fcdfd80c8c983996f0383f8 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Tue, 3 Apr 2018 12:32:53 -0600 Subject: TST: Update travis and appveyor to use pytest. For the time being, these tests will ignore the flood of deprecated yield test warnings. Fixing those is for another PR. --- tools/test-installed-numpy.py | 6 +++--- tools/travis-before-install.sh | 2 +- tools/travis-test.sh | 13 ++++++++----- 3 files changed, 12 insertions(+), 9 deletions(-) (limited to 'tools') diff --git a/tools/test-installed-numpy.py b/tools/test-installed-numpy.py index 26a50b2fa..04a2a1da2 100644 --- a/tools/test-installed-numpy.py +++ b/tools/test-installed-numpy.py @@ -27,11 +27,11 @@ parser.add_option("--doctests", help="Run doctests in module") parser.add_option("--coverage", action="store_true", dest="coverage", default=False, - help="report coverage of NumPy code (requires 'coverage' module") + help="report coverage of NumPy code (requires 'pytest-cov' module") parser.add_option("-m", "--mode", action="store", dest="mode", default="fast", help="'fast', 'full', or something that could be " - "passed to nosetests -A [default: %default]") + "passed to pytest [default: %default]") (options, args) = parser.parse_args() import numpy @@ -52,7 +52,7 @@ result = numpy.test(options.mode, doctests=options.doctests, coverage=options.coverage) -if result.wasSuccessful(): +if result: sys.exit(0) else: sys.exit(1) diff --git a/tools/travis-before-install.sh b/tools/travis-before-install.sh index 5e5278ce5..1671d35b4 100755 --- a/tools/travis-before-install.sh +++ b/tools/travis-before-install.sh @@ -26,6 +26,6 @@ fi source venv/bin/activate python -V pip install --upgrade pip setuptools -pip install nose pytz cython +pip install nose pytz cython pytest if [ -n "$USE_ASV" ]; then pip install asv; fi popd diff --git a/tools/travis-test.sh b/tools/travis-test.sh index bd9f79c22..70c512ea1 100755 --- a/tools/travis-test.sh +++ b/tools/travis-test.sh @@ -95,7 +95,8 @@ setup_chroot() # install needed packages sudo chroot $DIR bash -c "apt-get install -qq -y \ - libatlas-base-dev gfortran python-dev python-nose python-pip cython" + libatlas-base-dev gfortran python-dev python-nose python-pip cython \ + python-pytest" } run_test() @@ -112,9 +113,11 @@ run_test() "import os; import numpy; print(os.path.dirname(numpy.__file__))") export PYTHONWARNINGS=default if [ -n "$RUN_FULL_TESTS" ]; then - $PYTHON ../tools/test-installed-numpy.py --mode=full + $PYTHON ../tools/test-installed-numpy.py -v --mode=full -- \ + --disable-pytest-warnings else - $PYTHON ../tools/test-installed-numpy.py + $PYTHON ../tools/test-installed-numpy.py -v -- \ + --disable-pytest-warnings fi if [ -n "$USE_ASV" ]; then pushd ../benchmarks @@ -147,7 +150,7 @@ if [ -n "$USE_WHEEL" ] && [ $# -eq 0 ]; then # Move out of source directory to avoid finding local numpy pushd dist pip install --pre --no-index --upgrade --find-links=. numpy - pip install nose + pip install nose pytest popd run_test elif [ -n "$USE_SDIST" ] && [ $# -eq 0 ]; then @@ -164,7 +167,7 @@ elif [ -n "$USE_SDIST" ] && [ $# -eq 0 ]; then # Move out of source directory to avoid finding local numpy pushd dist pip install numpy* - pip install nose + pip install nose pytest popd run_test elif [ -n "$USE_CHROOT" ] && [ $# -eq 0 ]; then -- cgit v1.2.1