summaryrefslogtreecommitdiff
path: root/numpy/testing/nosetester.py
Commit message (Collapse)AuthorAgeFilesLines
* REL: Set raise_warnings to "release" in NoseTester constructor.Charles Harris2013-08-311-1/+1
|
* 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.
* 2to3: Use absolute imports.Charles Harris2013-03-281-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new import `absolute_import` is added the `from __future__ import` statement and The 2to3 `import` fixer is run to make the imports compatible. There are several things that need to be dealt with to make this work. 1) Files meant to be run as scripts run in a different environment than files imported as part of a package, and so changes to those files need to be skipped. The affected script files are: * all setup.py files * numpy/core/code_generators/generate_umath.py * numpy/core/code_generators/generate_numpy_api.py * numpy/core/code_generators/generate_ufunc_api.py 2) Some imported modules are not available as they are created during the build process and consequently 2to3 is unable to handle them correctly. Files that import those modules need a bit of extra work. The affected files are: * core/__init__.py, * core/numeric.py, * core/_internal.py, * core/arrayprint.py, * core/fromnumeric.py, * numpy/__init__.py, * lib/npyio.py, * lib/function_base.py, * fft/fftpack.py, * random/__init__.py Closes #3172
* 2to3: Put `from __future__ import division in every python file.Charles Harris2013-03-011-0/+2
| | | | | | | | This should be harmless, as we already are division clean. However, placement of this import takes some care. In the future a script can be used to append new features without worry, at least until such time as it exceeds a single line. Having that ability will make it easier to deal with absolute imports and printing updates.
* TST: also filter Cython warnings in NoseTester. See PR-432.Ralf Gommers2012-11-211-0/+2
| | | | There a resetwarnings() call, so need to add back these filters.
* DOC: merge wiki edits. Add percentile to statistics routines (ML suggestion).Ralf Gommers2012-07-071-5/+6
|
* BUG: fix running tests with coverage=True.Ralf Gommers2012-05-101-1/+1
| | | | | | | The --cover-inclusive argument means that coverage.py tries to include every single .py file in the source tree in the coverage report. This leads to test errors, because it tries to import files like setupscons.py (which will of course directly fail for anyone not having numscons installed).
* FIX: Implement Ralph's suggestion of removing category.Charles Harris2012-04-151-6/+2
|
* BUG: Fix testing failure on missing ImportWarning in Python 2.4.Charles Harris2012-04-151-14/+18
|
* TST: filter ImportWarnings in NoseTester.Ralf Gommers2012-04-141-0/+3
| | | | | | | | | | Warnings show up when a directory with the same name as a Python file or compiled extension is seen which doesn't have an __init__.py file in it. This situation is very common, for example in SciPy where many extensions are created from source files located under a directory with the same name. This filter is located within a context manager, so only filters when running tests.
* DOC: minor correction to NoseTester doc.Ralf Gommers2012-03-041-1/+1
|
* TST: add some string kw options to simplify switching NoseTester behavior.Ralf Gommers2012-03-041-15/+22
|
* TST: add "raise on warning" behavior to NoseTester constructor.Ralf Gommers2012-03-041-19/+31
| | | | | Also document that behavior has to be switched for a release, and remove comments on turning on deprecation warnings that don't apply anymore.
* WRN: A small tweak to make deprecation warnings always at least printMark Wiebe2012-03-041-0/+3
|
* TST,WRN: Add a parameter to control which warnings raise during testingMark Wiebe2012-03-041-7/+14
| | | | | | The default is set to (RuntimeWarning, DeprecationWarning), and the intent is to leave it as this on master, but change it to () immediately after branching for 1.7 in that branch.
* TST: Make RuntimeWarning raise an error during tests, same asMark Wiebe2012-02-081-0/+2
| | | | RegressionWarning
* TST: Make deprecation warnings raise exceptions during test runMark Wiebe2012-02-071-4/+17
|
* ENH: skip doctests for testsMatthew Brett2011-08-161-8/+7
| | | | | | | | | | | | There are various docstrings show examples of how to run the tests, and give example test output. Obviously the test output changes, and running the doctests for the testing package: import numpy.testing as npt npt.test(doctests=True) will cause several large sets of tests to be run in the rest of the tree. So I skipped these.
* ENH: move doctest tests to own file with ifmainMatthew Brett2011-08-161-29/+0
| | | | | | | The doctesting tests were in the code file, and (for me) rather difficult to run without running lots of other tests. With this change you can run the doctest tests in isolation by executing the test_doctesting.py file.
* ENH: refactor testing to improve subclass supportMatthew Brett2011-08-161-23/+39
| | | | | | | Refactor ``prepare_test_args`` method to make it easier for subclasses to adapt its behavior. This should make it easier for nipy and other projects to use the numpy testing machinery without wholesale copies into their source trees.
* ENH: refactor of docteset plugin managementMatthew Brett2011-08-161-55/+40
| | | | | | | | | | | | | | We previously had a baroque inheritance scheme to deal with the case where the user had normal nose doctests enabled in their environment. However, this scheme didn't deal with bench() routine, and was complicated. This commit uses a null Unplugger plugin to pull the doctest plugin off the nose configuration after it has been initialized. We can use this for bench() and test(), and it allows the doctest module to be enabled (by the user environment) and then thrown away. Also rejigged the docstrings and removed the automated docstring addition as the docstrings have already been copied and adapted in the code.
* STY: Replace assert by assert_ in tests. There remain 124 uses ofCharles Harris2011-04-051-3/+5
| | | | assert in non-testing files that should be checked for correctness.
* STY: Update exception style, easy ones.Charles Harris2011-04-051-1/+1
|
* TST: disable --detailed-errors by default -- the output it gives is more ↵Pauli Virtanen2010-09-111-3/+0
| | | | confusing than useful
* ENH: testing: do not exclude array_from_pyobj from tests; it's now fixed to ↵Pauli Virtanen2010-03-061-1/+0
| | | | be nose-compatible
* ENH: testing: always enable --detailed-errors assert introspection in nosePauli Virtanen2010-02-211-0/+3
|
* FIX - allow doctest tester to parse config before being replaced by NumpyDocTestMatthew Brett2009-12-291-9/+2
|
* Docstring update: testingPauli Virtanen2009-10-021-34/+156
|
* Fix #1168: fix functionality broken in r7132, and make get_package_path more ↵Pauli Virtanen2009-08-291-3/+12
| | | | robust
* Fixed #1168: more robust NoseTester package name detection (patch by Gaël ↵Pauli Virtanen2009-07-121-6/+11
| | | | Varoquaux)
* Remove the following deprecated items from numpy.testing:Alan McIntyre2008-12-311-66/+40
| | | | | | | | | | | | | | | - ParametricTestCase - The following arguments from numpy.testing.Tester.test(): level, verbosity, all, sys_argv, testcase_pattern - Path manipulation functions: set_package_path, set_local_path, restore_path - NumpyTestCase, NumpyTest Also separated testing parameter setup from NoseTester.test into NoseTester.prepare_test_args for use in a utility script for valgrind testing (see NumPy ticket #784).
* Renamed classes to conform to PEP 8.Alan McIntyre2008-09-041-2/+2
|
* Replaced numpy.testing.decorators.skipknownfailure with knownfailureif, Alan McIntyre2008-09-041-2/+2
| | | | | which allows flagging tests as known failures rather than skips. Updated test_umath to use knownfailureif.
* reindenting prior to releaseJarrod Millman2008-09-021-1/+1
|
* Bail out of _docmethod earlier if method has no docstring.Alan McIntyre2008-08-271-2/+4
|
* Make _docmethod work correctly when run with -OOAlan McIntyre2008-08-271-1/+2
|
* Added benchmarks directory to lib/setup.py so that numpy.lib benchmarks are Alan McIntyre2008-08-261-15/+24
| | | | | available in an installed NumPy. Display system configuration information when benchmarks are run.
* ran reindentJarrod Millman2008-08-081-17/+16
|
* Added numpy.testing.verbose, to allow tests to vary output accordingly.Alan McIntyre2008-07-211-0/+18
| | | | | | | Added numpy.testing.print_assert_equal, to allow removing the multiple identical implementations of this function in SciPy tests. Display version info for NumPy, Python, and nose (and SciPy when running SciPy tests), in a manner similar to the original test framework.
* Instead of importing nose plugins, use the existing list of classes that Alan McIntyre2008-07-191-7/+16
| | | | | | nose.plugins.builtins imports. If --with-doctest is included in extra_argv, remove it and use the NumPy doctester instead.
* Comment cleanup.Alan McIntyre2008-07-181-1/+1
| | | | Fixed __import__ calls for Python 2.4 (__import__ doesn't take keyword args in 2.4).
* Use a subclass of the nose doctest plugin instead of monkeypatching the ↵Alan McIntyre2008-07-181-186/+75
| | | | | | builtin plugin. Removed decorators for NoseTester methods.