summaryrefslogtreecommitdiff
path: root/numpy/core/tests
diff options
context:
space:
mode:
authormattip <matti.picus@gmail.com>2019-11-06 14:27:50 -0700
committermattip <matti.picus@gmail.com>2019-11-06 14:27:50 -0700
commite6a9c112bd3c08bfc4e51fa3c5345c0085c314ab (patch)
treee9ade33691d9801c996f6f6c1f65b9059ebfdf54 /numpy/core/tests
parent480dc6bc01aa465389fcad0c85502d25d954f579 (diff)
downloadnumpy-e6a9c112bd3c08bfc4e51fa3c5345c0085c314ab.tar.gz
MAINT: revert gh-14800, which gave precedence to OO->O over OO->?
Diffstat (limited to 'numpy/core/tests')
-rw-r--r--numpy/core/tests/test_deprecations.py3
-rw-r--r--numpy/core/tests/test_ufunc.py15
-rw-r--r--numpy/core/tests/test_umath.py6
3 files changed, 8 insertions, 16 deletions
diff --git a/numpy/core/tests/test_deprecations.py b/numpy/core/tests/test_deprecations.py
index 9bdcd8241..363ff26db 100644
--- a/numpy/core/tests/test_deprecations.py
+++ b/numpy/core/tests/test_deprecations.py
@@ -175,8 +175,7 @@ class TestComparisonDeprecations(_DeprecationTestCase):
# 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)
- res = op(a, b)
- assert res.dtype == 'object'
+ self.assert_deprecated(op, args=(a, b), num=None)
def test_string(self):
# For two string arrays, strings always raised the broadcasting error:
diff --git a/numpy/core/tests/test_ufunc.py b/numpy/core/tests/test_ufunc.py
index d9f961581..ba1aee55b 100644
--- a/numpy/core/tests/test_ufunc.py
+++ b/numpy/core/tests/test_ufunc.py
@@ -1090,18 +1090,13 @@ class TestUfunc(object):
return '=='
arr0d = np.array(HasComparisons())
- assert_equal(arr0d == arr0d, '==')
- assert_equal(np.equal(arr0d, arr0d), '==')
- assert_equal(np.equal(arr0d, arr0d, dtype=bool), True)
- assert_equal(np.equal(arr0d, arr0d, dtype=object), '==')
+ assert_equal(arr0d == arr0d, True)
+ assert_equal(np.equal(arr0d, arr0d), True) # normal behavior is a cast
arr1d = np.array([HasComparisons()])
- ret_obj = np.array(['=='], dtype=object)
- ret_bool = np.array([True])
- assert_equal(arr1d == arr1d, ret_obj)
- assert_equal(np.equal(arr1d, arr1d), ret_obj)
- assert_equal(np.equal(arr1d, arr1d, dtype=object), ret_obj)
- assert_equal(np.equal(arr1d, arr1d, dtype=bool), ret_bool)
+ assert_equal(arr1d == arr1d, np.array([True]))
+ assert_equal(np.equal(arr1d, arr1d), np.array([True])) # normal behavior is a cast
+ assert_equal(np.equal(arr1d, arr1d, dtype=object), np.array(['==']))
def test_object_array_reduction(self):
# Reductions on object arrays
diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py
index 96a9f1f8b..1d71766ef 100644
--- a/numpy/core/tests/test_umath.py
+++ b/numpy/core/tests/test_umath.py
@@ -173,8 +173,7 @@ class TestComparisons(object):
# 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)
- b = np.equal(a, a.copy())
- assert b.shape == a.shape
+ assert_raises(ValueError, np.equal, a, a)
# Check error raised when comparing identical non-comparable objects.
class FunkyType(object):
@@ -192,8 +191,7 @@ class TestComparisons(object):
# 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)
- b = np.not_equal(a, a.copy())
- assert b.shape == a.shape
+ assert_raises(ValueError, np.not_equal, a, a)
# Check error raised when comparing identical non-comparable objects.
class FunkyType(object):