Commit ebaea3a7 authored by theos's avatar theos

Added tests for binary operations together with data with subslice shape.

parent 006ed9a3
......@@ -1357,6 +1357,25 @@ class Test_unary_and_binary_operations(unittest.TestCase):
assert_equal(getattr(obj, function)(b).get_full_data(),
getattr(a, function)(b))
###############################################################################
@parameterized.expand(
itertools.product(binary_non_inplace_operators,
all_distribution_strategies,
all_distribution_strategies,
[(1, 8, 9), (7, 1, 9), (1, 1, 1)]),
testcase_func_name=custom_name_func)
def test_binary_operations_with_subslice_d2o(self, function, strat1,
strat2, reduced_shape):
full_shape = (7, 8, 9)
(a, obj) = generate_data(full_shape, np.dtype('float'), strat1)
(b, p) = generate_data(reduced_shape, np.dtype('float'), strat2)
b **= 3
p **= 3
assert_equal(getattr(obj, function)(p).get_full_data(),
getattr(a, function)(b))
###############################################################################
def test_binary_operation_with_dtype_conversion(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment