summaryrefslogtreecommitdiff
path: root/numpy/testing/nosetester.py
Commit message (Collapse)AuthorAgeFilesLines
* DEP: remove deprecate (and private) numpy.testing submodules.Ralf Gommers2019-09-211-19/+0
| | | | | | | | | | | Removes these files that were deprecated since 1.15.0: - numpy/testing/decorators.py - numpy/testing/noseclasses.py - numpy/testing/nosetester.py This also resolves a failure in the recently introduced tests in `test_public_api.py` (see gh-14454). Closes gh-14566
* MAINT: add version since deprecation in the deprecation message.Matthias Bussonnier2018-09-251-2/+2
| | | | | | | | | | | | | | | Otherwise the deprecation message is not that helpful as I have to dig through the source to find out since when and whether conditional import is necessary in my code. I may not have numpy on my dev machine (this message was on CI). So it's one extra step for the consumer. That's also for you, you have more chance of having consumer update their code when they have more informations in the deprecation message, so you can drop old code faster ! At least kudo to Charles Harris for including a comments just above, that prevented me from having to git blame and go spelunking for knowing which versions were or not affected.
* DEP: Issue deprecation warnings for some imports.Charles Harris2018-04-061-2/+6
| | | | | | | | | | | | | | The following modules have been moved or renamed and should not be imported. This adds shim modules for the old names that issue a DeprecationWarning on import. * numpy/core/umath_tests.py * numpy/testing/decorators.py * numpy/testing/noseclasses.py * numpy/testing/nosetester.py * numpy/testing/utils.py Closes #10845.
* BUG: Fix obvious warning bugs.Charles Harris2018-03-301-2/+2
| | | | The warning type is the second, not the first, argument.
* MAINT: Warn when importing numpy.testing.<module>.Charles Harris2018-03-291-2/+4
| | | | | Downstream projects were importing directly from the testing modules rather than from testing. Discourage this.
* MAINT: Rearrange numpy/testing files.Charles Harris2018-03-291-1/+1
| | | | | | | | | This is to prepare for the switch to pytest. * Rename `numpy/testing/nose_tools` to `numpy/testing/_private`. * Redirect imports as needed. * Copy `_testutils.py` from scipy to `numpy/testing/_private`. * Rename `_testutils.py` to `_pytester.py` and remove unneeded bits.
* ENH: do backward compatibility correctlyxoviat2017-12-221-4/+1
|
* ENH: Make numpy.testing pytest aware.Charles Harris2017-12-221-1/+7
| | | | | | | When the environment has NPY_PYTEST=1, the testing utilities will be pytest compatible. Typical usage would be something like $ NPY_PYTEST=1 pytest ...
* MAINT: Rearrange files in numpy/testing module.Charles Harris2017-07-041-542/+6
| | | | | | | | | | | | | | | | | The aim here is to separate out the nose dependent files prior to adding pytest support. This could be done by adding new files to the general numpy/testing directory, but I felt that it was to have the relevant files separated out as it makes it easier to completely remove nose dependencies when needed. Many places were accessing submodules in numpy/testing directly, and in some cases incorrectly. That presented a backwards compatibility problem. The solution adapted here is to have "dummy" files whose contents will depend on whether of not pytest is active. That way the module looks the same as before from the outside. In the case of numpy itself, direct accesses have been fixed. Having proper `__all__` lists in the submodules helped in that.
* TST: Move nose plugin initialization outside of testing loopSebastian Berg2017-06-271-3/+3
| | | | | | | It seems ok to let this warning show up, and it does not directly relate to the test run itself, so moving it before setting up the warnings for the actual tests (and printing out the system info, so that it is not confused to originate in the actual tests).
* ENH: testing: add a "timer" keyword to ``Tester.test`` to time slow tests.Ralf Gommers2017-06-211-3/+15
| | | | Useful because no one can remember the magic ``extra_argv`` incantation.
* ENH: testing: load available nose plugins that are external to nose itselfRalf Gommers2017-06-211-0/+11
| | | | | | | Motivation is to be able to use `nose-timer` within the test() function. Try (after installing nose-timer): np.test(extra_argv=['--with-timer', '--timer-top-n', '20'])
* DEP: Add back ndarray.__[sg]etslice__Eric Wieser2017-04-191-0/+2
| | | | These now delegate to __getitem__, so subclasses no longer need to define them
* MAINT: Remove __setslice__ and __getslice__Eric Wieser2017-02-091-2/+0
| | | | | This code was only here for Python 2.5 compatibility, but numpy requires 2.7 at minimum
* DEP: Fix escaped string characters deprecated in Python 3.6.Charles Harris2016-12-141-1/+1
| | | | | | | In Python 3.6 a number of escape sequences that were previously accepted -- for instance "\(" that was translated to "\\(" -- are deprecated. To retain the previous behavior either raw strings must be used or the backslash must be properly escaped itself.
* MAINT: make regex strings rawJulian Taylor2016-12-121-5/+5
| | | | | Python 3.6 gets more strict about escape sequences, \. is invalid. As it could get a syntax error the version check would not work.
* ENH: Deprecation warnings for `/` integer division when running python -3saurabh2016-11-011-1/+14
| | | | | | When python is invoked with switch -3, it emits waring "classic int division" for strict integer divisions. The same behavior is now implemented to numpy with this fix
* ENH: Use new context manager for testingSebastian Berg2016-09-021-16/+27
| | | | | | Making the outer context manager a suppress warnings gives good control to print warnings only once in release mode and suppress some specific warnings which cannot be easily avoided otherwise.
* STY: Small PEP8 cleanups.Charles Harris2016-08-281-0/+2
|
* ENH,TST: Add new warning suppression/filtering contextSebastian Berg2016-08-281-21/+2
| | | | | | This context has a couple of advantages over the typical one, and can ensure that warnings are cleanly filtered without side effect for later tests.
* MAINT: remove unused f2py and SWIG tests from numpy.distutils.Ralf Gommers2016-01-061-9/+0
|
* MAINT: remove outdated Pyrex support from distutils (as far as possible).Ralf Gommers2016-01-061-1/+0
|
* DOC: update min nose version in import error message, and add note to READMERalf Gommers2015-12-311-1/+1
| | | | Addresses comment in gh-4074.
* [TST] Refactor new raise_warnings logic for subpackage test suitesNathaniel J. Smith2015-12-301-2/+15
|
* [FIX] fix NoseTester's raise_warning defaultNathaniel J. Smith2015-12-291-14/+11
| | | | | | | | | | | | | | | | Our test-runner's raise_warning mode traditionally has varied depending on whether we have a development or release version of numpy: for development versions we raise on warnings, and for release versions we don't. This is all very sensible... *if* you're running numpy's test suite. But our test-runner is also used by other packages like scipy, and it doesn't make sense for scipy's raise_warning mode to vary depending on whether *numpy* is a development or release version. (It should vary depending on whether the scipy-under-test is a development or release version.) So this commit moves the numpy-version-dependent raise_warning logic out of the generic NoseTester class and into numpy-specific code. (See scipy/scipy#5609 for more discussion.)
* ENH: testing: add SkipTest and KnownFailureExceptionEvgeni Burovski2015-11-161-4/+4
| | | | | | | | * use SkipTest in numpy tests instead of importing it from nose * add a KnownFailureException as an alias for KnownFailureTest (the former is preferred, but the latter is kept for backcompat) * rename the KnownFailure nose plugin into KnownFailurePlugin, and keep the old name for backcompat
* BUG: Fix for #6569, allowing build_ext --inplaceWendell Smith2015-10-281-1/+2
|
* TST: raise errors for dev versions and warnings for releases on test runs.Ralf Gommers2015-10-151-9/+13
| | | | | This approach is less error prone than switching from "develop" to "release" in maintenance branches by hand. See gh-6461 for details.
* MAINT: fix raise_warnings in np.test in py3Allan Haldane2015-07-271-1/+1
| | | | | | | In python3 np.test would raise an error if raise_warnings is a list since dict.keys() now returns a dict_keys instance. Eg, np.test('full', raise_warnings=[FutureWarning])
* Merge pull request #6055 from seberg/test-warn-alwaysRalf Gommers2015-07-261-3/+3
|\ | | | | TST: Make default for all warnings "always"
| * TST: Make default for all warnings "always"Sebastian Berg2015-07-081-3/+3
| | | | | | | | | | | | | | | | | | This should make it easier in some cases, since a warning caught in some test (but not important/not causing failure), will not shadow later tests. In principle the best thing is probably to always check the number of warnings raised, so that you notice when a new warning shows up in a test, though there may be other corner cases here.
* | STY: PEP8 fixes for numpy/testing numpy/testing/tests.Charles Harris2015-07-051-7/+6
|/
* MAINT: filter out some warnings triggered by nose 1.3.7 + python 3.5b2Nathaniel J. Smith2015-06-241-0/+6
| | | | | | Filed upstream as: https://github.com/nose-devs/nose/issues/929 Not our problem.
* DOC: Reconcile docstrings and function signatures where they disagreeRobert McGibbon2015-03-021-2/+2
| | | | | Fixed typos in docstrings were updated for functions where the parameter names in the docstring didn't match the function signature.
* TST: report relaxed strides setting alongside the numpy version and path at ↵alex2014-12-021-0/+2
| | | | the beginning of nosetests
* TST: pass sys.argv to run_module_suite by defaultJulian Taylor2014-09-041-2/+2
| | | | | allows passing flags like --pdb to test files also add call to files where its missing
* MAINT:Ignore boolean '-' deprecation warnings in nosetester.pyCharles Harris2014-05-061-0/+4
| | | | | | | | This allows numpy 1.9 testing to be used with current scipy without flooding the output with deprecation warnings. The deprecation warnings are currently issued for both the subtract and negative operators when used with booleans.
* BUG: testing.run_module_suite() didn't pass on KnownFailure.Ralf Gommers2014-01-181-6/+9
| | | | | | This results in errors whenever you run tests using KnownFailure like so: ``python test_mymodule.py`` (where run_module_suite is used in the file, like numpy and scipy do).
* STY: Style adjustments to run_module_suite.Pascal Bugnion2014-01-151-1/+3
| | | | | Cosmetic adjustments to previous commit (893fe99) following "charris"'s comments.
* DOC: Added docstring for run_module_suite.Pascal Bugnion2014-01-151-0/+32
|
* ENH: Added argv argument to run_module_suite.Pascal Bugnion2014-01-151-2/+6
| | | | | | | | | | | | | | | Adding an 'argv' optional argument to the "numpy.testing.run_module_suite" function lets the client pass arguments to the nose testrunner. For example, this lets the user add things like: run_module_suite(sys.argv) at the end of a test module, so that arguments specified on the command line will get passed to the nose runner. The user could then run: $ python test_module.py --nocapture
* STY: Giant comma spacing fixup.Charles Harris2013-08-181-3/+3
| | | | | | | Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long and will need to be broken at some point. OTOH, some lines were already too long and need to be broken at some point. Now seems as good a time as any to do this with open PRs at a minimum.
* STY: Giant whitespace cleanup.Charles Harris2013-08-181-1/+0
| | | | Now is as good a time as any with open PR's at a low.
* MAINT: Refactor nanfunctions.Charles Harris2013-08-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nanmax, nanmin -------------- Add out and keepdims keywords. nanargmin, nanargmax -------------------- A NanWarning is raised if an all NaN slice detected. For all such slices np.iingo(np.intp).min is returned as the index value. nansum ------ The keywords dtype, out, and keepdims are added. A FutureWarning is raised, as in the future the mean of an empty slice after NaN replacement will be 0 instead of the current NaN. nanmean, nanvar, nanstd ----------------------- For all, if the input array is of inexact type then the dtype and out parameters must be of inexact type if specified. That insures that NaNs can be returned when appropriate. The nanmean function detects empty slices after NaN replacement and raises a NanWarning. NaN is returned as the value for all such slices. The nanmean and nanstd functions detect degrees of freedom <= 0 after NaN replacement and raise a NanWarning. NaN is returned as the value for all such slices.
* MAINT: remove unused and broken parts of numpy.testingRalf Gommers2013-08-101-2/+1
| | | | Deprecate np.testing.importall - it's pointless and partially broken.
* MAINT: Remove uses of the WarningManager class.Charles Harris2013-07-121-23/+18
| | | | | | | | | | | | WarningManager was a workaround for the lack of the with statement in Python versions < 2.6. As those versions are no longer supported it can be removed. Deprecation notes are added to WarningManager and WarningMessage, but to avoid a cascade of messages in third party apps, no warnings are raised at this time, that can be done later. Closes #3519.
* DEP: Deprecate the oldnumeric and numarray modules.Charles Harris2013-06-101-0/+2
| | | | | | | | | The numarray and oldnumeric modules are deprecated. This is a bit tricky as raising a DeprecationWarning on import causes an error when tests are run. To deal with that, a ModuleDeprecationWarning class is added to numpy and NoseTester is modified to ignore that warning during testing. Closes #2905
* BUG: testing: always enable --exePauli Virtanen2013-05-091-0/+8
| | | | | | Setuptools tends to set +x to the installed test scripts, which makes numpy.test() to not run any tests. Having --exe always enabled is not problematic because only files matching 'test_*.py' are looked into.
* 2to3: Apply basestring fixer.Charles Harris2013-04-131-0/+1
| | | | | | | | | | | The basestring class is not defined in Python 3 and the fixer replaces it with str. In order to have a common code base we define basestring in numpy/compat/py3k.py to be str when the Python version is >= 3, otherwise basestring and import it where needed. That works for most cases, but there are a few files where the version dependent define needs to be in the file. Closes #3042.
* 2to3: Apply `print` fixer.Charles Harris2013-04-061-10/+10
| | | | | | | Add `print_function` to all `from __future__ import ...` statements and use the python3 print function syntax everywhere. Closes #3078.