diff options
author | mattip <matti.picus@gmail.com> | 2019-10-29 23:10:31 +0200 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2019-10-29 23:10:31 +0200 |
commit | 647ea1908cc33eb2f9fb6c5828cfb895f8663cc0 (patch) | |
tree | 2da5d0f07adecdad06af1b44ced5e59f42ac41f5 /numpy/core/tests | |
parent | 117220ff29bcbc85bc888f8590d3653a9e9808f4 (diff) | |
download | numpy-647ea1908cc33eb2f9fb6c5828cfb895f8663cc0.tar.gz |
WIP, DEP, ENH: finish richcompare changes from 1.10
Diffstat (limited to 'numpy/core/tests')
-rw-r--r-- | numpy/core/tests/test_deprecations.py | 5 | ||||
-rw-r--r-- | numpy/core/tests/test_umath.py | 10 |
2 files changed, 9 insertions, 6 deletions
diff --git a/numpy/core/tests/test_deprecations.py b/numpy/core/tests/test_deprecations.py index 8bffaa9af..9bdcd8241 100644 --- a/numpy/core/tests/test_deprecations.py +++ b/numpy/core/tests/test_deprecations.py @@ -172,10 +172,11 @@ class TestComparisonDeprecations(_DeprecationTestCase): # (warning is issued a couple of times here) self.assert_deprecated(op, args=(a, a[:-1]), num=None) - # Element comparison error (numpy array can't be compared). + # ragged array comparison returns True/False a = np.array([1, np.array([1,2,3])], dtype=object) b = np.array([1, np.array([1,2,3])], dtype=object) - self.assert_deprecated(op, args=(a, b), num=None) + res = op(a, b) + assert res.dtype == 'object' def test_string(self): # For two string arrays, strings always raised the broadcasting error: diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py index 9b4ce9e47..96a9f1f8b 100644 --- a/numpy/core/tests/test_umath.py +++ b/numpy/core/tests/test_umath.py @@ -170,10 +170,11 @@ class TestOut(object): class TestComparisons(object): def test_ignore_object_identity_in_equal(self): - # Check error raised when comparing identical objects whose comparison + # Check comparing identical objects whose comparison # is not a simple boolean, e.g., arrays that are compared elementwise. a = np.array([np.array([1, 2, 3]), None], dtype=object) - assert_raises(ValueError, np.equal, a, a) + b = np.equal(a, a.copy()) + assert b.shape == a.shape # Check error raised when comparing identical non-comparable objects. class FunkyType(object): @@ -188,10 +189,11 @@ class TestComparisons(object): assert_equal(np.equal(a, a), [False]) def test_ignore_object_identity_in_not_equal(self): - # Check error raised when comparing identical objects whose comparison + # Check comparing identical objects whose comparison # is not a simple boolean, e.g., arrays that are compared elementwise. a = np.array([np.array([1, 2, 3]), None], dtype=object) - assert_raises(ValueError, np.not_equal, a, a) + b = np.not_equal(a, a.copy()) + assert b.shape == a.shape # Check error raised when comparing identical non-comparable objects. class FunkyType(object): |