summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_regression.py
Commit message (Collapse)AuthorAgeFilesLines
* MAINT: simplify code that assumes str/unicode and int/long are different ↵Eric Wieser2020-03-261-2/+1
| | | | | types (#15816) Cleanup from the dropping of python 2
* MAINT: Clean up, mostly unused imports.Warren Weckesser2020-01-231-1/+0
|
* MAINT: Remove sys.version checks in testsSeth Troisi2020-01-151-4/+1
|
* MAINT: Remove implicit inheritance from object class (#15236)Jon Dufresne2020-01-051-1/+1
| | | | | | | Inheriting from object was necessary for Python 2 compatibility to use new-style classes. In Python 3, this is unnecessary as there are no old-style classes. Dropping the object is more idiomatic Python.
* MAINT: Remove unnecessary 'from __future__ import ...' statementsJon Dufresne2020-01-031-2/+0
| | | | | As numpy is Python 3 only, these import statements are now unnecessary and don't alter runtime behavior.
* MAINT: Replace integers in places where booleans are expectedMSeifert042019-07-011-3/+3
|
* MAINT: Remove all uses of run_module_suite.Charles Harris2018-04-061-6/+2
| | | | | That function is nose specific and has not worked since `__init__` files were added to the tests directories.
* MAINT: Remove `level=` keyword from test arguments.Charles Harris2017-08-051-18/+16
| | | | | | I don't know what that argument was used for, but it showis up in old tests and is not explicitly used within the tests. I assume it was part of an old testing framework and is now longer needed.
* MAINT/DOC: Use builtin when np.{x} is builtins.{x}.Eric Wieser2017-08-051-9/+9
| | | | | | | This is the case for x in {int, bool, str, float, complex, object}. Using the np.{x} version is deceptive as it suggests that there is a difference. This change doesn't affect any external behaviour. The `long` type is missing in python 3, so np.long is still useful
* TST: Remove unittest dependencies in numpy/lib/tests.Charles Harris2017-07-241-5/+5
|
* MAINT: Rearrange files in numpy/testing module.Charles Harris2017-07-041-2/+1
| | | | | | | | | | | | | | | | | 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.
* BUG: KeyboardInterrupt is swallowed all over the placeEric Wieser2017-06-031-3/+3
| | | | Bare except is very rarely the right thing
* DOC, MAINT: Enforce np.ndarray arg for np.put and np.placegfyoung2016-01-141-4/+0
| | | | | | | np.put and np.place do something only when the first argument is an instance of np.ndarray. These changes will cause a TypeError to be thrown in either function should that requirement not be satisfied.
* MAINT: Fix problems noted by pyflakes in numpy/lib/tests.Charles Harris2014-07-311-29/+33
|
* TST: Raise AssertionError on failureJoseph Martinot-Lagarde2013-10-101-0/+2
|
* TST: Regression test for gh-2561Joseph Martinot-Lagarde2013-10-091-0/+14
|
* DEP, MAINT: Remove references to numeric and numarray.Charles Harris2013-09-231-4/+4
| | | | | This covers those locations that either import or build numarray or numeric.
* STY: Make numpy/lib/test/*.py PEP8 compliant.Charles Harris2013-09-031-14/+19
| | | | | | | Run autopep8 over the test files in numpy/lib/test and make fixes to the result. Also remove Python5 workaround.
* STY: Giant comma spacing fixup.Charles Harris2013-08-181-38/+38
| | | | | | | 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.
* 2to3: Apply unicode fixer.Charles Harris2013-04-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | The unicode fixer strips the u from u'hi' and converts the unicode type to str. The first won't work for Python 2 and instead we replace the u prefix with the sixu function borrowed from the six compatibility package. That function calls the unicode constructor with the 'unicode_escape' encoder so that the many tests using escaped unicode characters like u'\u0900' will be handled correctly. That makes the sixu function a bit different from the asunicode function currently in numpy.compat and also provides a target that can be converted back to the u prefix when support for Python 3.2 is dropped. Python 3.3 reintroduced the u prefix for compatibility. The unicode fixer also replaces 'unicode' with 'str' as 'unicode' is no longer a builtin in Python 3. For code compatibility, 'unicode' is defined either as 'str' or 'unicode' in numpy.compat so that checks like if isinstance(x, unicode): ... will work properly for all python versions. Closes #3089.
* 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: Apply `imports` fixer.Charles Harris2013-04-021-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The `imports` fixer deals with the standard packages that have been renamed, removed, or methods that have moved. cPickle -- removed, use pickle commands -- removed, getoutput, getstatusoutput moved to subprocess urlparse -- removed, urlparse moved to urllib.parse cStringIO -- removed, use StringIO or io.StringIO copy_reg -- renamed copyreg _winreg -- renamed winreg ConfigParser -- renamed configparser __builtin__ -- renamed builtins In the case of `cPickle`, it is imported as `pickle` when python < 3 and performance may be a consideration, but otherwise plain old `pickle` is used. Dealing with `StringIO` is a bit tricky. There is an `io.StringIO` function in the `io` module, available since Python 2.6, but it expects unicode whereas `StringIO.StringIO` expects ascii. The Python 3 equivalent is then `io.BytesIO`. What I have done here is used BytesIO for anything that is emulating a file for testing purposes. That is more explicit than using a redefined StringIO as was done before we dropped support for Python 2.4 and 2.5. Closes #3180.
* 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: 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.
* BUG: Make nansum work with booleans.Charles Harris2013-02-121-0/+9
| | | | | | | | This broke when function_base._nannop tried to fill a boolean array with integer zeros, raising a 'safe_casting' error. It looks like nanargmax and nanargmin would also break, and were probably incorrect for booleans in any case. The fix is not to use fill values for boolean and integer dtypes. Previously that was only done for the integer dtypes.
* ENH: Allow bincount to accept empty arrays.Skipper Seabold2012-03-041-4/+0
|
* BUG: loadtxt: There was some extra nesting for subarray dtypes (Ticket #1936)Mark Wiebe2011-08-201-0/+20
|
* TST: fix ResourceWarning under Python 3.2rgommers2011-03-111-0/+1
|
* DEP: remove deprecated get_numpy_include.rgommers2011-03-111-3/+1
|
* TST: clean up some ResourceWarnings from python 3.2.rgommers2011-03-021-11/+13
| | | | | Also make the sys.stdout temporary redirection in one of the tests a little more robust. That is still necessary, because np.who is very noisy.
* TST: Add regression test for ticket #1676.Charles Harris2010-11-241-0/+12
|
* Don't deprecated bias keyword, just add ddof.Charles Harris2010-07-071-2/+2
|
* ENH: Add ddof keyword to cov and corrcoef. Deprecate bias keyword.Charles Harris2010-07-071-2/+2
|
* ENH: Add test of polyder return type.Charles Harris2010-05-051-0/+8
|
* BUG: move test from core to lib, mark it as deprected.David Cournapeau2010-03-311-0/+11
|
* DEP: Fix deprecation warnings in Python 3.1. The warnings come from the unittestCharles Harris2010-02-201-3/+3
| | | | | | | | | 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
* removed old behavior for the histogram function.dhuard2010-02-161-10/+0
|
* BUG: fix #1387. Raise ValueError for empty input to bincount.David Cournapeau2010-02-021-0/+3
|
* Don't include assert_valid_refcount in numpy.testing.*Pauli Virtanen2009-10-101-1/+2
| | | | It's a private function used only in two internal regression tests.
* Add regression test for ticker #1243.Charles Harris2009-09-301-0/+13
|
* All non core regressions tests moved to their respective modules.David Cournapeau2009-09-161-9/+119
|
* Fixed #1140: avoid div-by-zero in iter_coords_get for size=0 arraysPauli Virtanen2009-06-191-0/+4
|
* Make test_histogramdd_too_many_bins a bit clearer.Charles Harris2009-04-101-1/+1
|
* Fix ticket #928Charles Harris2009-04-101-0/+4
|
* Fix polyint to work correctly with float, complex, and int inputs.Charles Harris2009-03-091-2/+16
| | | | Fix polydiv to work correctly with float, complex, and int inputs.
* Fix ticket #944.Charles Harris2009-03-091-3/+8
|
* ran reindentJarrod Millman2008-08-081-1/+0
|
* Remove uses of set_package_path, set_local_path, restore_path.Alan McIntyre2008-07-031-3/+0
| | | | | Clean up and (somewhat) standardize test module imports. Removed unneeded reload calls.
* Restore old test framework classes.Alan McIntyre2008-06-211-1/+2
| | | | | | | | | | | 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-2/+2
| | | | modules.