Skip to content

Commit b178207

Browse files
committed
add test_coerced_usm_types_floor_divide
1 parent aac66a6 commit b178207

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/test_usm_type.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,25 @@ def test_coerced_usm_types_remainder(usm_type_x, usm_type_y):
9494
assert z.usm_type == du.get_coerced_usm_type([usm_type_x, usm_type_y])
9595

9696

97+
@pytest.mark.parametrize("usm_type_x", list_of_usm_types, ids=list_of_usm_types)
98+
@pytest.mark.parametrize("usm_type_y", list_of_usm_types, ids=list_of_usm_types)
99+
def test_coerced_usm_types_floor_divide(usm_type_x, usm_type_y):
100+
x = dp.arange(100, usm_type=usm_type_x).reshape(10, 10)
101+
y = dp.arange(100, usm_type=usm_type_y).reshape(10, 10)
102+
x = x + 1.5
103+
y = y.T + 0.5
104+
105+
z = x // y
106+
107+
# inplace floor_divide
108+
z //= y
109+
z //= 2.5
110+
111+
assert x.usm_type == usm_type_x
112+
assert y.usm_type == usm_type_y
113+
assert z.usm_type == du.get_coerced_usm_type([usm_type_x, usm_type_y])
114+
115+
97116
@pytest.mark.parametrize("usm_type_x", list_of_usm_types, ids=list_of_usm_types)
98117
@pytest.mark.parametrize("usm_type_y", list_of_usm_types, ids=list_of_usm_types)
99118
def test_coerced_usm_types_power(usm_type_x, usm_type_y):

0 commit comments

Comments
 (0)