summaryrefslogtreecommitdiff
path: root/numpy/testing
Commit message (Collapse)AuthorAgeFilesLines
* HTTP -> HTTPS, and other linkrot fixesMike Toews2018-06-163-6/+6
|
* Merge pull request #11122 from mhvk/assert-array-comparison-with-maskedCharles Harris2018-06-072-41/+53
|\ | | | | BUG,MAINT: Ensure masked elements can be tested against nan and inf.
| * MAINT: clean up assert_array_compare a bit further.Marten van Kerkwijk2018-06-042-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This brought to light two bugs in tests, which are fixed here, viz., that a sample ndarray subclass that tested propagation of an added parameter was incomplete, in that in propagating the parameter in __array_wrap__ it assumed it was there on self, but that assumption could be broken when a view of self was taken (as is done by x[~flagged] in the test routine), since there was no __array_finalize__ defined. The other subclass bug counted, incorrectly, on only needing to provide one type of comparison, the __lt__ being explicitly tested. But flags are compared with __eq__ and those flags will have the same subclass.
| * BUG,MAINT: Ensure masked elements can be tested against nan and inf.Marten van Kerkwijk2018-05-272-38/+41
| | | | | | | | | | | | | | The removal of nan and inf from arrays that are compared using test routines like assert_array_equal treated the two arrays separately, which for masked arrays meant that some elements would not be removed when they should have been. This PR corrects this.
* | BUG: Import WarningMessage from warnings.Charles Harris2018-06-041-0/+1
| |
* | MAINT: Remove dead code backporting py2.6 warningsEric Wieser2018-06-041-92/+0
|/ | | | Since this is now in `np.testing._private`, it's no longer usable by the outside world anyway
* TST: disable gc in refcount test (#11158)Matti Picus2018-05-241-5/+9
| | | | | | | The vectorize version of this test was failing consistently on several of the Appveyor builds, ever since a recent pytest upgrade. Our theory is that by random chance, things changed so that during the call to vectorize(op).__call__, python started running a garbage collection, which perturbed the refcounts that this test is checking. (Specifically this test is doing a weird thing and checking that the refcount of the object 1 doesn't decrease, and it's very plausible that some random bit of garbage was holding a reference to this object.) Disabling the gc during the test makes this kind of refcount assertion more reliable, and seems to have fixed the appveyor builds, so I guess it's good.
* BUG: Ensure that fully masked arrays pass assert_array_equal.Marten van Kerkwijk2018-05-192-1/+23
| | | | | The underlying problem is that ma.all() evaluates to masked, which is falsy, and thus triggers test failures.
* Merge pull request #11010 from mhvk/poly-matrix-tests-to-matrixlibCharles Harris2018-05-151-30/+2
|\ | | | | Move remaining Matrix tests to matrixlib
| * MAINT: move matrix tests in testing to matrixlib.Marten van Kerkwijk2018-04-291-30/+2
| |
* | MAINT: Misc. typos (#11005)luzpaz2018-04-301-1/+1
|/ | | | | | | | | User- and non-user-facing typos. Some source typos fixes as well. Found via `codespell`.
* BUG: Ensure the garbage is clear first in assert_no_gc_cyclesEric Wieser2018-04-152-19/+73
| | | | It's not always possible to guarantee this, so also adds a test to verify that we don't hang
* ENH: Show the full list of leaked objectsEric Wieser2018-04-121-2/+21
| | | | | | | | | An example output for the test added in the previous commit is: AssertionError: Reference cycles were found when calling make_cycle: 1 objects were collected, of which 1 are shown below: list object with id=2279664872136: [<Recursion on list with id=2279664872136>, <Recursion on list with id=2279664872136>]
* TST: Extract a helper function to test for reference cyclesEric Wieser2018-04-123-3/+92
| | | | | | This also means we can now test that our test is actually able to detect the type of failure we expect Trying to give myself some tools to debug the failure at https://github.com/numpy/numpy/pull/10882/files#r180813166
* Merge pull request #10850 from charris/deprecate-some-importsCharles Harris2018-04-094-9/+24
|\ | | | | DEP: Issue deprecation warnings for some imports.
| * DEP: Issue deprecation warnings for some imports.Charles Harris2018-04-064-9/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | MAINT: Remove now unused pytest_tools.Charles Harris2018-04-066-3465/+0
| |
* | MAINT: Remove all uses of run_module_suite.Charles Harris2018-04-062-16/+6
|/ | | | | That function is nose specific and has not worked since `__init__` files were added to the tests directories.
* TST: Update modules `test` to PytestTester.Charles Harris2018-04-041-2/+4
| | | | | | | | Numpy can now be tested using the standard `python -c"import numpy; numpy.test()"` construct.
* TST: Switch to using pytest markersCharles Harris2018-04-043-161/+186
| | | | | | | | | | | Use standard pytest markers everywhere in the numpy tests. At this point there should be no nose dependency. However, nose is required to test the legacy decorators if so desired. At this point, numpy test cannot be run in the way with runtests, rather installed numpy can be tested with `pytest --pyargs numpy` as long as that is not run from the repo. Run it from the tools directory or some such.
* TST: Update pytest.ini and PytestTesterCharles Harris2018-04-041-11/+30
| | | | | | | | * Make PytestTester callable. * Rename 'timer' to 'durations', corresponding with pytest. * Offset 'verbose', no entry is now '-q'. * Move some `ignore` warnings into PytestTester so that they affect releases, not just develop.
* ENH: Add tester for pytest.Charles Harris2018-03-311-0/+175
| | | | | | [ci skip] This is not used yet, but has been tested with temporary changes and works.
* Merge pull request #10830 from charris/fix-testing-warningsRalf Gommers2018-03-303-6/+6
|\ | | | | BUG: Fix obvious warning bugs.
| * BUG: Fix obvious warning bugs.Charles Harris2018-03-303-6/+6
| | | | | | | | The warning type is the second, not the first, argument.
* | DOC: Fix minor typosluz.paz2018-03-302-2/+2
|/ | | Found via `codespell -q 3 -I ../numpy-whitelist.txt`
* BUG: fix obvious mistake in testing/decorators warning.Ralf Gommers2018-03-291-2/+2
|
* MAINT: Warn when importing numpy.testing.<module>.Charles Harris2018-03-294-4/+18
| | | | | Downstream projects were importing directly from the testing modules rather than from testing. Discourage this.
* MAINT: Rearrange numpy/testing files.Charles Harris2018-03-2912-8/+13
| | | | | | | | | 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.
* TST: Rename some compiled c test modulesCharles Harris2018-03-241-1/+1
| | | | | | The renamed C modules provide low level functions for testing. The rename marks them as private functions and makes them invisible to pytest by default.
* TST: Remove some nose dependences in utils.pyCharles Harris2018-03-231-7/+49
| | | | | | | | | | | | The `assert_raises` and `assert_raises_regex` testing utilities were being imported from nose, which in turn took them from unittest `assertRaises` and `assertRaisesRegex`. We takeover the nose procedure here so that these commonly used utilities no longer have a nose dependence. The `raises` decorator continues to have a nose dependency, but that only shows up when used, and NumPy does not use it. Document that and otherwise leave it be.
* MAINT: Remove use of unittest in NumPy tests.xoviat2018-03-211-209/+169
| | | | | | | | | | | | | | | | This removes a few left over uses of unittest. The main changes apart from removal of Test case are: * `setUp` replaced by nose and pytest compatible `setup` * `tearDown` replaced by nose and pytest compatible `teardown` * `assertRaises` replaced by `assert_raises` * `assertEqual` replaced by `assert_equal` The last two are in `numpy/testings/tests/test_utils.py`, so may seem a but circular, but at least are limited to those two functions. The use of `setup` and `teardown`, can be fixed up with the pytest equivalents after we have switched to pytest.
* MAINT: Fix test_utils.py for Python 3.7.Charles Harris2018-03-191-14/+29
| | | | | | The contents of the module warnings registries was made more module specific in Python 3.7 and consequently the tests of the context managers clear_and_catch_warnings and suppress_warnings need updating.
* TST: Import abstract classes from collections.abcFrederick Lefebvre2018-03-142-8/+18
| | | | | | | | Abstract collection classes accessed from the collections module have been deprecated since Python 3.3. They should be accessed through collections.abc. When run with Python 3.7, the deprecation warning cause multiple tests to fail.
* Merge pull request #10718 from AaronCritchley/tst-fixing-float16-eqCharles Harris2018-03-133-2/+36
|\ | | | | BUG: Fix bug in asserting near equality of float16 arrays.
| * MAINT: Increase range in float16 almost equal nulp test.Charles Harris2018-03-131-2/+4
| |
| * TST: Fixing bug in assert near equality of float16 arrays (#10697)Aaron Critchley2018-03-103-2/+34
| |
* | Fix low-hanging Pypy compatibility issues (#10737)Pauli Virtanen2018-03-122-4/+9
|/ | | | | | | | | | | | | * TST: skip refcount-requiring tests if sys.refcount is missing * ENH: io: add refcheck=False to a safe .resize() call The array is allocated immediately above, and the resize always succeeds so it is not necessary to check it. Fixes Pypy compatibility. * TST: remove unused code * TST: factor skipif(not HAS_REFCOUNT) into a separate decorator
* DOC/MAINT: More misc. typosluz.paz2018-02-271-2/+2
| | | Found via `codespell` and `grep`
* MAINT: simplify pytest assert_raisesxoviat2017-12-291-9/+2
|
* DEP: restore noseclassesxoviat2017-12-221-0/+5
|
* ENH: do backward compatibility correctlyxoviat2017-12-223-12/+3
|
* BUG: Fix pytest implementation errorsxoviat2017-12-221-4/+17
|
* wipCharles Harris2017-12-221-322/+324
|
* wip nosetesterCharles Harris2017-12-221-12/+13
|
* ENH: Add pytest compatible run_module_suite.Charles Harris2017-12-221-46/+40
|
* ENH: Make numpy.testing pytest aware.Charles Harris2017-12-223-4/+20
| | | | | | | 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: Remove noseclasses from user accessible modules.Charles Harris2017-12-221-6/+0
| | | | The noseclasses module should not be imported by users.
* MAINT: Fix unused IgnoreException in nose_tools/utils.pyCharles Harris2017-12-221-0/+1
| | | | | It did not have `pass` in the definition. It appears unused, so should be removed at some point.
* MAINT: Hardwire 'nose' in parameterized.py.Charles Harris2017-12-221-1/+2
|
* MAINT: Add __all__ to nose_tools/decorators.py.Charles Harris2017-12-221-0/+3
|