diff --git a/.coveragerc b/.coveragerc index 1f61c25a4e0c..9048b9cc427c 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,3 +1,4 @@ [run] branch = True include = */numpy/* +disable_warnings = include-ignored diff --git a/tools/test-installed-numpy.py b/tools/test-installed-numpy.py deleted file mode 100755 index 5240253b60ff..000000000000 --- a/tools/test-installed-numpy.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python -from __future__ import division, absolute_import, print_function - -# A simple script to test the installed version of numpy by calling -# 'numpy.test()'. Key features: -# -- convenient command-line syntax -# -- sets exit status appropriately, useful for automated test environments - -# It would be better to set this up as a module in the numpy namespace, so -# that it could be run as: -# python -m numpy.run_tests -# But, python2.4's -m switch only works with top-level modules, not modules -# that are inside packages. So, once we drop 2.4 support, maybe... - -import sys, os -# In case we are run from the source directory, we don't want to import numpy -# from there, we want to import the installed version: -sys.path.pop(0) - -from optparse import OptionParser -parser = OptionParser("usage: %prog [options] -- [nosetests options]") -parser.add_option("-v", "--verbose", - action="count", dest="verbose", default=1, - help="increase verbosity") -parser.add_option("--doctests", - action="store_true", dest="doctests", default=False, - help="Run doctests in module") -parser.add_option("--coverage", - action="store_true", dest="coverage", default=False, - 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 pytest [default: %default]") -parser.add_option("-n", "--durations", - dest="durations", default=-1, - help="show time to run slowest N tests [default: -1]") -(options, args) = parser.parse_args() - -import numpy - -# Check that NPY_RELAXED_STRIDES_CHECKING is active when set. -# The same flags check is also used in the tests to switch behavior. -if (os.environ.get('NPY_RELAXED_STRIDES_CHECKING', "1") != "0"): - if not numpy.ones((10, 1), order='C').flags.f_contiguous: - print('NPY_RELAXED_STRIDES_CHECKING set, but not active.') - sys.exit(1) -elif numpy.ones((10, 1), order='C').flags.f_contiguous: - print('NPY_RELAXED_STRIDES_CHECKING not set, but active.') - sys.exit(1) - -if options.coverage: - # Produce code coverage XML report for codecov.io - args += ["--cov-report=xml"] - -result = numpy.test(options.mode, - verbose=options.verbose, - extra_argv=args, - doctests=options.doctests, - durations=int(options.durations), - coverage=options.coverage) - -if result: - sys.exit(0) -else: - sys.exit(1) diff --git a/tools/travis-test.sh b/tools/travis-test.sh index d900b88e7f9f..77eb66b0b1e0 100755 --- a/tools/travis-test.sh +++ b/tools/travis-test.sh @@ -83,9 +83,9 @@ run_test() export PYTHONWARNINGS=default if [ -n "$RUN_FULL_TESTS" ]; then export PYTHONWARNINGS="ignore::DeprecationWarning:virtualenv" - $PYTHON ../tools/test-installed-numpy.py -v --durations 10 --mode=full $COVERAGE_FLAG + $PYTHON ../runtests.py -n -v --durations 10 --mode=full $COVERAGE_FLAG else - $PYTHON ../tools/test-installed-numpy.py -v --durations 10 + $PYTHON ../runtests.py -n -v --durations 10 fi if [ -n "$RUN_COVERAGE" ]; then diff --git a/tox.ini b/tox.ini index 75229ed86c5d..3223b9e1b0fa 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,7 @@ # To run against a specific subset of Python versions, use: # tox -e py37 -# Extra arguments will be passed to test-installed-numpy.py. To run +# Extra arguments will be passed to runtests.py. To run # the full testsuite: # tox full # To run with extra verbosity: @@ -33,7 +33,7 @@ envlist = deps= pytest changedir={envdir} -commands={envpython} {toxinidir}/tools/test-installed-numpy.py --mode=full {posargs:} +commands={envpython} {toxinidir}/runtests.py --mode=full {posargs:} [testenv:py37-not-relaxed-strides] basepython=python3.7 @@ -43,4 +43,4 @@ env=NPY_RELAXED_STRIDES_CHECKING=0 # if you want it: [testenv:debug] basepython=python-dbg -commands=gdb --args {envpython} {toxinidir}/tools/test-installed-numpy.py --mode=full {posargs:} +commands=gdb --args {envpython} {toxinidir}/runtests.py --mode=full {posargs:}