| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
BUG,MAINT: Ensure masked elements can be tested against nan and inf.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
|/
|
|
| |
Since this is now in `np.testing._private`, it's no longer usable by the outside world anyway
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
The underlying problem is that ma.all() evaluates to masked,
which is falsy, and thus triggers test failures.
|
|\
| |
| | |
Move remaining Matrix tests to matrixlib
|
| | |
|
|/
|
|
|
|
|
|
|
| |
User- and non-user-facing typos.
Some source typos fixes as well.
Found via `codespell`.
|
|
|
|
| |
It's not always possible to guarantee this, so also adds a test to verify that we don't hang
|
|
|
|
|
|
|
|
|
| |
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>]
|
|
|
|
|
|
| |
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
|
|\
| |
| | |
DEP: Issue deprecation warnings for some imports.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
|/
|
|
|
| |
That function is nose specific and has not worked since `__init__` files
were added to the tests directories.
|
|
|
|
|
|
|
|
| |
Numpy can now be tested using the standard
`python -c"import numpy; numpy.test()"`
construct.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
[ci skip]
This is not used yet, but has been tested with temporary changes
and works.
|
|\
| |
| | |
BUG: Fix obvious warning bugs.
|
| |
| |
| |
| | |
The warning type is the second, not the first, argument.
|
|/
|
| |
Found via `codespell -q 3 -I ../numpy-whitelist.txt`
|
| |
|
|
|
|
|
| |
Downstream projects were importing directly from the testing modules
rather than from testing. Discourage this.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
BUG: Fix bug in asserting near equality of float16 arrays.
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
| |
Found via `codespell` and `grep`
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
When the environment has NPY_PYTEST=1, the testing utilities will be
pytest compatible. Typical usage would be something like
$ NPY_PYTEST=1 pytest ...
|
|
|
|
| |
The noseclasses module should not be imported by users.
|
|
|
|
|
| |
It did not have `pass` in the definition. It appears unused, so should
be removed at some point.
|
| |
|
| |
|