diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2018-04-03 12:32:53 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2018-04-04 06:42:18 -0600 |
commit | 7f68c8a6a38049284fcdfd80c8c983996f0383f8 (patch) | |
tree | 325dd93055916cb9954d64fff516adfb148bc455 | |
parent | 0938043c04726a2cd4d8acfb225dca3a19868b44 (diff) | |
download | numpy-7f68c8a6a38049284fcdfd80c8c983996f0383f8.tar.gz |
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.
-rw-r--r-- | .appveyor.yml | 45 | ||||
-rw-r--r-- | tools/test-installed-numpy.py | 6 | ||||
-rwxr-xr-x | tools/travis-before-install.sh | 2 | ||||
-rwxr-xr-x | tools/travis-test.sh | 13 |
4 files changed, 31 insertions, 35 deletions
diff --git a/.appveyor.yml b/.appveyor.yml index 091767a1c..f001aa041 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -8,10 +8,6 @@ max_jobs: 100 cache: - '%LOCALAPPDATA%\pip\Cache' -matrix: - allow_failures: - - USE_PYTEST: true - environment: global: MINGW_32: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin @@ -27,7 +23,7 @@ environment: - PYTHON: C:\Python34-x64 PYTHON_VERSION: 3.4 PYTHON_ARCH: 64 - USE_PYTEST: true + TEST_MODE: fast - PYTHON: C:\Python36 PYTHON_VERSION: 3.6 @@ -107,30 +103,27 @@ build_script: # Here, we add MinGW to the path to be able to link an OpenBLAS.dll # We then use the import library from the DLL to compile with MSVC - ps: | - If ($env:USE_PYTEST -eq "true") { - pip install -e . - } Else { - pip wheel -v -v -v --wheel-dir=dist . - - # For each wheel that pip has placed in the "dist" directory - # First, upload the wheel to the "artifacts" tab and then - # install the wheel. If we have only built numpy (as is the case here), - # then there will be one wheel to install. - - # This method is more representative of what will be distributed, - # because it actually tests what the built wheels will be rather than - # what 'setup.py install' will do and at it uploads the wheels so that - # they can be inspected. - - ls dist -r | Foreach-Object { - appveyor PushArtifact $_.FullName - pip install $_.FullName - } + pip wheel -v -v -v --wheel-dir=dist . + + # For each wheel that pip has placed in the "dist" directory + # First, upload the wheel to the "artifacts" tab and then + # install the wheel. If we have only built numpy (as is the case here), + # then there will be one wheel to install. + + # This method is more representative of what will be distributed, + # because it actually tests what the built wheels will be rather than + # what 'setup.py install' will do and at it uploads the wheels so that + # they can be inspected. + + ls dist -r | Foreach-Object { + Push-AppveyorArtifact $_.FullName + pip install $_.FullName } test_script: - - if [%USE_PYTEST%]==[true] pytest -n3 --junitxml=junit-results.xml - - if [%USE_PYTEST%]==[] python runtests.py -v -n -m %TEST_MODE% + #- if [%USE_PYTEST%]==[true] pytest -n3 --junitxml=junit-results.xml + #- if [%USE_PYTEST%]==[] python runtests.py -v -n -m %TEST_MODE% + python runtests.py -v -n -m %TEST_MODE% -- --disable-pytest-warnings after_build: # Remove old or huge cache files to hopefully not exceed the 1GB cache limit. 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 |