summaryrefslogtreecommitdiff
path: root/numpy/testing/tests/test_utils.py
Commit message (Collapse)AuthorAgeFilesLines
...
* 2to3: Apply `print` fixer.Charles Harris2013-04-061-1/+1
| | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Replace xrange by range and use list(range(...)) where neededCharles Harris2013-03-271-1/+1
| | | | | | | | | | | | | | | In python3 range is an iterator and `xrange` has been removed. This has two consequence for code: 1) Where a list is needed `list(range(...))` must be used. 2) `xrange` must be replaced by `range` Both of these changes also work in python2 and this patch makes both. There are three places fixed that do not need it, but I left them in so that the result would be `xrange` clean. Closes #3092
* 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.
* ENH: More capable test functions for warningsNathaniel J. Smith2012-09-201-1/+5
| | | | | | | 1) New function assert_no_warnings 2) Make assert_warns and assert_no_warnings pass through the function's return value on success, so that it can be checked as well.
* [FIX] Make np.random.shuffle less brain-deadNathaniel J. Smith2012-07-171-4/+7
| | | | | | | | | The logic in np.random.shuffle was... not very sensible. Fixes trac ticket #2074. This patch also exposes a completely unrelated issue in numpy.testing. Filed as Github issue #347 and marked as knownfail for now.
* BUG: fix assert_almost_equal and co. to work with infs.rgommers2011-03-121-0/+9
|
* ENH: ufunc: Make many more tests pass with the new ufunc codeMark Wiebe2011-01-211-1/+1
|
* ENH: testing: add assert_tol_equal for testing array equality with specified ↵Pauli Virtanen2010-07-281-0/+23
| | | | tolerances
* DEP: Fix deprecation warnings in Python 3.1. The warnings come from the unittestCharles Harris2010-02-201-23/+23
| | | | | | | | | module. The fix should be good for Python >= 2.4 and used the following sed script: s/\<failUnless\>/assertTrue/g s/\<failIf\>/assertFalse/g s/\<failUnlessEqual\>/assertEqual/g s/\<failUnlessRaises\>/assertRaises/g
* TST: add simple test for complex arrays input to assert_array_almost_equal_nulp.David Cournapeau2010-02-091-0/+13
|
* BUG: fix 2.5 >= try/except/finally.David Cournapeau2009-11-231-5/+6
|
* ENH: add an assert_warns testing utility.David Cournapeau2009-11-231-0/+34
|
* REF: move spacing tests to umath as spacing is now a ufunc.David Cournapeau2009-11-101-39/+0
|
* ENH: add assert_array_max_ulp comparison function.David Cournapeau2009-10-301-0/+53
| | | | | This new comparison raises an error if the number of representable numbers between two arrays exceeds a tolerance.
* ENH: add robust comparison function for floating numbers.David Cournapeau2009-10-301-0/+27
| | | | | | assert_array_almost_equal_nulp use spacing so that a single tolerance number can be used independently on the amplitude of the floating point number.
* ENH: add numpy implementation of F90 spacing function.David Cournapeau2009-10-301-0/+38
|
* BUG: handle inf/nan correctly in assert_array_almost_equal.David Cournapeau2009-07-281-0/+1
|
* BUG: fix nan/inf handling for complex dtypes.David Cournapeau2009-07-281-0/+15
|
* Handle complex special values and negative zero.David Cournapeau2009-07-271-0/+16
| | | | | Complex with nan/inf are correctly handled in assert_equal, as well as negative zero.
* Handle nan and inf in assert_equal.David Cournapeau2009-07-271-1/+19
|
* BUG: handle nan/inf in assert_approx_equal.David Cournapeau2009-07-271-0/+56
|
* BUG: assert_array_compare did not raise an exception when the nan indexes of ↵David Cournapeau2009-07-271-0/+12
| | | | both arguments did not match.
* Handle nan and inf in assert_almost_equal.David Cournapeau2009-07-271-1/+20
|
* Fixed #745: make assert_array_almost_equal work with object arraysPauli Virtanen2009-03-091-0/+5
|
* Small cleanup.Charles Harris2008-08-291-3/+1
|
* Standardize NumPy import as "import numpy as np".Alan McIntyre2008-07-221-19/+19
|
* Restore old test framework classes.Alan McIntyre2008-06-211-1/+1
| | | | | | | | | | | Added numpy.testing.run_module_suite to simplify "if __name__ == '__main__'" boilerplate code in test modules. Removed numpy/testing/pkgtester.py since it just consisted of an import statement after porting SciPy r4424. Allow numpy.*.test() to accept the old keyword arguments (but issue a deprecation warning when old arguments are seen). numpy.*.test() returns a test result object as before. Fixed typo in distutils doc.
* Switched to use nose to run tests. Added test and bench functions to all ↵Alan McIntyre2008-06-171-4/+3
| | | | modules.
* Correct dependency on missing code.Robert Kern2008-04-171-9/+45
|
* Fix test for assert* with nan values + string formatting issue when handling ↵David Cournapeau2008-04-081-4/+7
| | | | nan.
* Add basic tests for assert_array_almost_equal.David Cournapeau2008-04-081-35/+47
|
* assert* funcs: Add generic test for rank 3 arrays.David Cournapeau2008-04-071-0/+19
|
* assert* funcs test: add generic test for rank1 arrays for all dtype.David Cournapeau2008-04-071-0/+18
|
* Test assert* funcs for arrays with Nan and rec arrays.David Cournapeau2008-04-071-0/+22
|
* Some more tests for assert_* functions.David Cournapeau2008-04-071-1/+28
|
* Start testing test functions.David Cournapeau2008-04-071-0/+30