Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
antonwolfy committed Jan 20, 2025
1 parent e200dc3 commit 6150308
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions dpnp/tests/test_ndarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,27 @@ def test_wrong_api_version(self, api_version):
)


class TestArrayUfunc:
def test_add(self):
a = numpy.ones(10)
b = dpnp.ones(10)
msg = "An array must be any of supported type"

with assert_raises_regex(TypeError, msg):
a + b

with assert_raises_regex(TypeError, msg):
b + a

def test_add_inplace(self):
a = numpy.ones(10)
b = dpnp.ones(10)
with assert_raises_regex(
TypeError, "operand 'dpnp_array' does not support ufuncs"
):
a += b


class TestItem:
@pytest.mark.parametrize("args", [2, 7, (1, 2), (2, 0)])
def test_basic(self, args):
Expand Down

0 comments on commit 6150308

Please sign in to comment.