Skip to content

Commit 6150308

Browse files
committed
Add tests
1 parent e200dc3 commit 6150308

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

dpnp/tests/test_ndarray.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,27 @@ def test_wrong_api_version(self, api_version):
150150
)
151151

152152

153+
class TestArrayUfunc:
154+
def test_add(self):
155+
a = numpy.ones(10)
156+
b = dpnp.ones(10)
157+
msg = "An array must be any of supported type"
158+
159+
with assert_raises_regex(TypeError, msg):
160+
a + b
161+
162+
with assert_raises_regex(TypeError, msg):
163+
b + a
164+
165+
def test_add_inplace(self):
166+
a = numpy.ones(10)
167+
b = dpnp.ones(10)
168+
with assert_raises_regex(
169+
TypeError, "operand 'dpnp_array' does not support ufuncs"
170+
):
171+
a += b
172+
173+
153174
class TestItem:
154175
@pytest.mark.parametrize("args", [2, 7, (1, 2), (2, 0)])
155176
def test_basic(self, args):

0 commit comments

Comments
 (0)