summaryrefslogtreecommitdiff
path: root/numpy/testing
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* MAINT: Make decorator tests work with new exceptions.Charles Harris2017-12-221-8/+8
| | | | | | | The KnowFailureException and SkipTest for pytest have delayed imports of _pytest in order to avoid a hard dependence on pytest. They return the pytest types XFailed and Skipped respectively when they are constructed, so the tests need to be adjusted to deal with that.
* ENH: Add pytest_tools directory.Charles Harris2017-12-226-0/+3452
| | | | | | | | | | | | | | Create numpy/testing/pytest_tools and populate it with pytest compatible versions of * decorators.py * utils.py * noseclasses.py * nosetester.py Note that noseclasses and nosetester are basically dummy modules at this point, they don't do anything, but they do import when nose is not present. Fixing the test runners is for another PR.
* DOC: fix minor typosUnknown2017-12-121-1/+1
|
* BUG: Fix numpy.testing.assert_equal in release mode.Charles Harris2017-12-101-3/+6
| | | | | | | | To be complete, the NaT handling needs to raise AssertionError when comparing NaT's with different types. That check was previously passed on and the resulting check, which would succeed in development mode because DeprecationWarning was converted to an error, warns in release mode.
* MAINT/BUG: Simplify _formatArray, fixing array_repr(matrix) in the processEric Wieser2017-12-061-1/+3
| | | | | | | | Now: * Has one recursive base case * Is fewer lines of code * Does not rstrip the result of format_function (none of the builtin ones have trailing spaces anyway) * Recurses in the index, instead of the value, which handles `dtype=object` arrays without the need for the rank argument. This fixes #8442.
* Merge pull request #10114 from Templarrr/masterCharles Harris2017-11-281-2/+1
|\ | | | | MAINT: Remove duplicate cond check from assert_array_compare
| * MAINT: Remove duplicate cond check from assert_array_compareMichael Odintsov2017-11-281-2/+1
| | | | | | We already in "if not cond" branch of code, we don't need to check it again
* | MAINT: Simplify IntegerFormatterEric Wieser2017-11-281-6/+9
|/ | | | | | This essentially reverts 83accefd143a0e3ee8b3160d0927b3ff616743de, which presumably worked around a bug in an ancient version of python Similarly, the try/excepts here were to handle `IntegerFormatter` being called on the wrong type of array, which no longer happens
* BUG: Fix assert_equal on time-like objectsEric Wieser2017-11-262-28/+46
| | | | | | Also does some cleanup on the float assert_equal to make it look more similar. Fixes #10081
* Merge pull request #9645 from xoviat/appveyorCharles Harris2017-09-301-9/+12
|\ | | | | ENH: enable OpenBLAS on windows.
| * TST: utils: fix string continuationxoviat2017-09-091-6/+6
| |