Skip test of subtract for boolean
@@ -259,11 +259,14 @@ class TestArrayElementwiseOp(unittest.TestCase):
@testing.for_all_dtypes_combination(names=['x_type', 'y_type'])
@testing.numpy_cupy_allclose(accept_error=TypeError)
def check_array_broadcasted_op(self, op, xp, x_type, y_type,
- no_complex=False):
+ no_complex=False, no_bool=False):
if no_complex:
if numpy.dtype(x_type).kind == 'c' \
or numpy.dtype(y_type).kind == 'c':
return xp.array(True)
+ if (no_bool and
+ (numpy.dtype(x_type) == '?' or numpy.dtype(y_type) == '?')):
+ return xp.array(True)
a = xp.array([[1, 2, 3], [4, 5, 6]], x_type)
b = xp.array([[1], [2]], y_type)
return op(a, b)
@@ -276,11 +279,13 @@ class TestArrayElementwiseOp(unittest.TestCase):
self.check_array_broadcasted_op(operator.iadd)
def test_broadcasted_sub(self):
- self.check_array_broadcasted_op(operator.sub)
+ # TODO(unno): sub for boolean array is deprecated in numpy>=1.13
+ self.check_array_broadcasted_op(operator.sub, no_bool=True)
@testing.with_requires('numpy>=1.10')
def test_broadcasted_isub(self):
- self.check_array_broadcasted_op(operator.isub)
+ # TODO(unno): sub for boolean array is deprecated in numpy>=1.13
+ self.check_array_broadcasted_op(operator.isub, no_bool=True)
def test_broadcasted_mul(self):
self.check_array_broadcasted_op(operator.mul)
