summaryrefslogtreecommitdiff
path: root/numpy/testing
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #7042 from charris/revert-7001Charles Harris2016-01-162-76/+6
|\ | | | | Revert "Merge pull request #7001 from shoyer/NaT-comparison"
| * Revert "Merge pull request #7001 from shoyer/NaT-comparison"Charles Harris2016-01-162-76/+6
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7141f40b58ed1e7071cde78ab7bc8ab37e9c5983, reversing changes made to 8fa6e3bef26a6d4a2c92f2824129aa4409be2590. The original broke some pandas tests. The current plan to get this in is * reversion * issue FutureWarning in 1.11 and 1.12 * make the change in 1.13.
* | DOC: document changes to assert_warnsStephan Hoyer2016-01-161-0/+4
| |
* | TST: Make assert_warns an optional contextmanagerStephan Hoyer2016-01-142-18/+66
|/
* TST, ENH: make all comparisons with NaT falseStephan Hoyer2016-01-142-6/+76
| | | | | | | | | Now, NaT compares like NaN: - NaT != NaT -> True - NaT == NaT (and all other comparisons) -> False We discussed this on the mailing list back in October: https://mail.scipy.org/pipermail/numpy-discussion/2015-October/073968.html
* MAINT: remove unused f2py and SWIG tests from numpy.distutils.Ralf Gommers2016-01-061-9/+0
|
* MAINT: remove outdated Pyrex support from distutils (as far as possible).Ralf Gommers2016-01-061-1/+0
|
* DEP: deprecate np.testing.randEvgeni Burovski2016-01-041-0/+3
|
* DOC: update min nose version in import error message, and add note to READMERalf Gommers2015-12-311-1/+1
| | | | Addresses comment in gh-4074.
* [TST] Refactor new raise_warnings logic for subpackage test suitesNathaniel J. Smith2015-12-302-3/+16
|
* [FIX] fix NoseTester's raise_warning defaultNathaniel J. Smith2015-12-291-14/+11
| | | | | | | | | | | | | | | | Our test-runner's raise_warning mode traditionally has varied depending on whether we have a development or release version of numpy: for development versions we raise on warnings, and for release versions we don't. This is all very sensible... *if* you're running numpy's test suite. But our test-runner is also used by other packages like scipy, and it doesn't make sense for scipy's raise_warning mode to vary depending on whether *numpy* is a development or release version. (It should vary depending on whether the scipy-under-test is a development or release version.) So this commit moves the numpy-version-dependent raise_warning logic out of the generic NoseTester class and into numpy-specific code. (See scipy/scipy#5609 for more discussion.)
* Merge pull request #6866 from charris/tempfile-context-managerCharles Harris2015-12-202-5/+63
|\ | | | | ENH: Tempfile context manager
| * MAINT: Use temppath in test_not_closing_opened_fid.Charles Harris2015-12-201-2/+6
| | | | | | | | | | The test is in numpy/lib/tests/test_io.py. This commit is intended as a demonstration of using temppath.
| * ENH: Add context manager `temppath` to manage a temporary file.Charles Harris2015-12-192-5/+59
| | | | | | | | | | | | | | | | | | | | | | | | Context manager intended for use when the same temporary file needs to be opened and closed more than once. The context manager creates the file, closes it, and returns the path to the file. On exit from the context block the file is removed. The file should be closed before exiting the context as an error will be raised on windows if not. Also fix up the `tempdir` context manager to deal with exceptions. Tests are added for both `temppath` and `tempdir`.
* | MAINT: Remove commented out code blocksgfyoung2015-12-201-12/+0
| |
* | DOC: Use print only as function when print_function is imported from __future__gfyoung2015-12-193-13/+13
|/ | | | Closes gh-6863.
* ENH: testing: add SkipTest and KnownFailureExceptionEvgeni Burovski2015-11-165-35/+52
| | | | | | | | * use SkipTest in numpy tests instead of importing it from nose * add a KnownFailureException as an alias for KnownFailureTest (the former is preferred, but the latter is kept for backcompat) * rename the KnownFailure nose plugin into KnownFailurePlugin, and keep the old name for backcompat
* BUG: testing: fix a bug in assert_string_equalPauli Virtanen2015-11-142-6/+24
|
* DOC: document that assert_raises can be used as a context managerEvgeni Burovski2015-11-121-0/+12
|
* BUG: Fix for #6569, allowing build_ext --inplaceWendell Smith2015-10-281-1/+2
|
* Merge pull request #5773 from ml31415/pytest_traceback_hidePauli Virtanen2015-10-171-0/+15
|\ | | | | ENH: Hide testing helper tracebacks when using them with pytest
| * PEP8 applied to commentsMichael Löffler2015-05-141-15/+15
| |
| * Comments addedMichael Löffler2015-04-201-15/+15
| |
| * pytest traceback hide markers set for testing helpersMichael Löffler2015-04-191-0/+15
| |
* | TST: raise errors for dev versions and warnings for releases on test runs.Ralf Gommers2015-10-151-9/+13
| | | | | | | | | | This approach is less error prone than switching from "develop" to "release" in maintenance branches by hand. See gh-6461 for details.
* | MAINT: fix raise_warnings in np.test in py3Allan Haldane2015-07-271-1/+1
| | | | | | | | | | | | | | In python3 np.test would raise an error if raise_warnings is a list since dict.keys() now returns a dict_keys instance. Eg, np.test('full', raise_warnings=[FutureWarning])
* | Merge pull request #6055 from seberg/test-warn-alwaysRalf Gommers2015-07-261-3/+3
|\ \ | | | | | | TST: Make default for all warnings "always"
| * | TST: Make default for all warnings "always"Sebastian Berg2015-07-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This should make it easier in some cases, since a warning caught in some test (but not important/not causing failure), will not shadow later tests. In principle the best thing is probably to always check the number of warnings raised, so that you notice when a new warning shows up in a test, though there may be other corner cases here.
* | | BUG: Fixed import error on Windows from not correctly defining aIan Henriksen2015-07-131-20/+23
| | | | | | | | | | | | function listed in __all__ for numpy/testing/utils.py.
* | | MAINT: pyflakes for numpy/testing, numpy/testing/tests.Charles Harris2015-07-054-53/+89
| | |
* | | STY: PEP8 fixes for numpy/testing numpy/testing/tests.Charles Harris2015-07-058-81/+87
|/ /
* | MAINT: filter out some warnings triggered by nose 1.3.7 + python 3.5b2Nathaniel J. Smith2015-06-241-0/+6
| | | | | | | | | | | | Filed upstream as: https://github.com/nose-devs/nose/issues/929 Not our problem.
* | MAINT: move the special case for void comparison before the regular caseNathaniel J. Smith2015-06-131-3/+26
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | The ndarray richcompare function has special case code for handling void dtypes (esp. structured dtypes), since there are no ufuncs for this. Previously, we would attempt to call the relevant ufunc (e.g. np.equal), and then when this failed (as signaled by the ufunc returning NotImplemented), we would fall back on the special case code. This commit moves the special case code to before the regular code, so that it no longer requires ufuncs to return NotImplemented. Technically, it is possible to define ufunc loops for void dtypes using PyUFunc_RegisterLoopForDescr, so technically I think this commit changes behaviour: if someone had registered a ufunc loop for one of these operations, then previously it might have been found and pre-empted the special case fallback code; now, we use the special-case code without even checking for any ufunc. But the only possible use of this functionality would have been if someone wanted to redefine what == or != meant for a particular structured dtype -- like, they decided that equality for 2-tuples of float32's should be different from the obvious thing. This does not seem like an important capability to preserve. There were also several cases here where on error, an array comparison would return a scalar instead of raising. This is supposedly deprecated, but there were call paths that did this that had no deprecation warning. I added those warnings.
* ENH: add clear_and_catch_warnings context managerMatthew Brett2015-03-142-2/+132
| | | | | | | Add context manager for tests that, on entry, clears record of any previous warnings from given modules, so that any warning raised in the context block does get raised, rather than suppressed by a previous warning causing an entry in the `__warningregistry_`` of the module.
* DOC: Reconcile docstrings and function signatures where they disagreeRobert McGibbon2015-03-022-2/+4
| | | | | Fixed typos in docstrings were updated for functions where the parameter names in the docstring didn't match the function signature.
* MAINT: Minor code edits.chebee7i2015-02-221-1/+1
|
* ENH: Add `equal_nan` argument to allclose.chebee7i2015-02-201-2/+5
|
* TST: Update assert_array_almost_equal_nulp testsRyan Nelson2015-01-111-39/+164
| | | | | | | | | | | | | | | | This fix addresses Issue #347. All of the tests in this class were using random numbers generated without a seed. This broke `test_simple` in a nondeterministic manner. Rewrote all tests for this function. Instead of using random numbers, well-defined arrays of widely varying amplitude were created instead. Changed the array modification values so that the test arrays were either just above or just below the NULP threshold. Added tests for float64, float32, complex128, and complex64 dtypes, and added both addition and subtraction tests. Tried to standardize the code for all tests.
* Merge pull request #5374 from lebigot/patch-1Julian Taylor2014-12-241-1/+1
|\ | | | | | | DOC: Fixed incorrect assert_array_almost_equal_nulp documentation
| * DOC: Fixed incorrect assert_array_almost_equal_nulp documentationEric O. LEBIGOT (EOL)2014-12-241-1/+1
| | | | | | | | | | | | The `max()` function previously used does not work with two array-like. `maximum()` does, and is what is essentially used in the code (`ref = nulp * np.spacing(np.where(ax > ay, ax, ay))`).
* | TST: report relaxed strides setting alongside the numpy version and path at ↵alex2014-12-021-0/+2
| | | | | | | | the beginning of nosetests
* | TST: Fix ImportError in runtests.py (fixes #5273)Chris Kerr2014-11-121-2/+1
| | | | | | | | In numpy/testing/__init__.py, import Tester before importing numpy core
* | MAINT: remove obsolete version checksJulian Taylor2014-10-151-1/+1
| | | | | | | | | | minimum requirement is python2.6, this allows removing a couple 2.3 and 2.4 checks.
* | Merge pull request #5048 from juliantaylor/subclass-test-fixCharles Harris2014-09-042-1/+9
|\ \ | | | | | | BUG: fix array_almost_equal for array subclasses
| * | BUG: fix array_almost_equal for array subclassesJulian Taylor2014-09-052-1/+9
| |/ | | | | | | introduced in gh-4105/ab04e1ae0e8eca717bc7e42f3b0a60c9ff764289
* | TST: pass sys.argv to run_module_suite by defaultJulian Taylor2014-09-041-2/+2
| | | | | | | | | | allows passing flags like --pdb to test files also add call to files where its missing
* | Use more portable test methods.Patrick Peglar2014-09-021-1/+5
| |
* | BUG: fix percentage reporting when testing.assert_allclose fails.Patrick Peglar2014-08-312-1/+6
| |
* | Merge pull request #4905 from juliantaylor/doc-updateCharles Harris2014-07-271-7/+12
|\ \ | | | | | | documentation updates
| * | DOC: numpy.testing documentation clarification of "Raise an assertion"Austin Godber2014-07-271-7/+12
| |/ | | | | | | | | | | | | | | "Raise an assertion" was changed to "Raises an AssertionError" to clarify that an exception named AssertionError will be raised. Closes gh-4884 [ci skip]