diff options
author | Stephan Hoyer <shoyer@google.com> | 2018-11-10 16:12:18 -0800 |
---|---|---|
committer | Stephan Hoyer <shoyer@google.com> | 2018-11-10 16:12:18 -0800 |
commit | b44284ebc42c496e5c5d906acc33ebbc337fd3b1 (patch) | |
tree | 52322a497bc9c0def2065c48ce0c00e8eee750a3 /numpy/testing/tests | |
parent | 56ce2327462eb9e3980c568ce9be628892aad89f (diff) | |
download | numpy-b44284ebc42c496e5c5d906acc33ebbc337fd3b1.tar.gz |
MAINT: more fixes for disabling overrides
Diffstat (limited to 'numpy/testing/tests')
-rw-r--r-- | numpy/testing/tests/test_utils.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py index e54fbc390..e35cdb6cf 100644 --- a/numpy/testing/tests/test_utils.py +++ b/numpy/testing/tests/test_utils.py @@ -180,18 +180,15 @@ class TestArrayEqual(_GenericTest): self._test_not_equal(b, a) def test_subclass_that_does_not_implement_npall(self): - # While we cannot guarantee testing functions will always work for - # subclasses, the tests should ideally rely only on subclasses having - # comparison operators, not on them being able to store booleans - # (which, e.g., astropy Quantity cannot usefully do). See gh-8452. class MyArray(np.ndarray): def __array_function__(self, *args, **kwargs): return NotImplemented a = np.array([1., 2.]).view(MyArray) b = np.array([2., 3.]).view(MyArray) - with assert_raises(TypeError): - np.all(a) + if np.core.overrides.ENABLE_ARRAY_FUNCTION: + with assert_raises(TypeError): + np.all(a) self._test_equal(a, a) self._test_not_equal(a, b) self._test_not_equal(b, a) |