Skip to content

Commit ee43c3b

Browse files
committed
Enable tests for logic and bitwise OPs
1 parent 531d347 commit ee43c3b

File tree

1 file changed

+68
-68
lines changed

1 file changed

+68
-68
lines changed

dpnp/tests/test_usm_type.py

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -379,83 +379,83 @@ def test_tril_triu(func, usm_type):
379379
assert x.usm_type == usm_type
380380

381381

382-
# @pytest.mark.parametrize(
383-
# "op",
384-
# [
385-
# "all",
386-
# "any",
387-
# "isfinite",
388-
# "isinf",
389-
# "isnan",
390-
# "isneginf",
391-
# "isposinf",
392-
# "logical_not",
393-
# ],
394-
# )
395-
# @pytest.mark.parametrize("usm_type_x", list_of_usm_types, ids=list_of_usm_types)
396-
# def test_coerced_usm_types_logic_op_1in(op, usm_type_x):
397-
# x = dp.arange(-10, 10, usm_type=usm_type_x)
398-
# res = getattr(dp, op)(x)
382+
@pytest.mark.parametrize(
383+
"op",
384+
[
385+
"all",
386+
"any",
387+
"isfinite",
388+
"isinf",
389+
"isnan",
390+
"isneginf",
391+
"isposinf",
392+
"logical_not",
393+
],
394+
)
395+
@pytest.mark.parametrize("usm_type_x", list_of_usm_types, ids=list_of_usm_types)
396+
def test_coerced_usm_types_logic_op_1in(op, usm_type_x):
397+
x = dp.arange(-10, 10, usm_type=usm_type_x)
398+
res = getattr(dp, op)(x)
399399

400-
# assert x.usm_type == res.usm_type == usm_type_x
400+
assert x.usm_type == res.usm_type == usm_type_x
401401

402402

403-
# @pytest.mark.parametrize(
404-
# "op",
405-
# [
406-
# "array_equal",
407-
# "array_equiv",
408-
# "equal",
409-
# "greater",
410-
# "greater_equal",
411-
# "isclose",
412-
# "less",
413-
# "less_equal",
414-
# "logical_and",
415-
# "logical_or",
416-
# "logical_xor",
417-
# "not_equal",
418-
# ],
419-
# )
420-
# @pytest.mark.parametrize("usm_type_x", list_of_usm_types, ids=list_of_usm_types)
421-
# @pytest.mark.parametrize("usm_type_y", list_of_usm_types, ids=list_of_usm_types)
422-
# def test_coerced_usm_types_logic_op_2in(op, usm_type_x, usm_type_y):
423-
# x = dp.arange(100, usm_type=usm_type_x)
424-
# y = dp.arange(100, usm_type=usm_type_y)[::-1]
403+
@pytest.mark.parametrize(
404+
"op",
405+
[
406+
"array_equal",
407+
"array_equiv",
408+
"equal",
409+
"greater",
410+
"greater_equal",
411+
"isclose",
412+
"less",
413+
"less_equal",
414+
"logical_and",
415+
"logical_or",
416+
"logical_xor",
417+
"not_equal",
418+
],
419+
)
420+
@pytest.mark.parametrize("usm_type_x", list_of_usm_types, ids=list_of_usm_types)
421+
@pytest.mark.parametrize("usm_type_y", list_of_usm_types, ids=list_of_usm_types)
422+
def test_coerced_usm_types_logic_op_2in(op, usm_type_x, usm_type_y):
423+
x = dp.arange(100, usm_type=usm_type_x)
424+
y = dp.arange(100, usm_type=usm_type_y)[::-1]
425425

426-
# z = getattr(dp, op)(x, y)
427-
# zx = getattr(dp, op)(x, 50)
428-
# zy = getattr(dp, op)(30, y)
426+
z = getattr(dp, op)(x, y)
427+
zx = getattr(dp, op)(x, 50)
428+
zy = getattr(dp, op)(30, y)
429429

430-
# assert x.usm_type == zx.usm_type == usm_type_x
431-
# assert y.usm_type == zy.usm_type == usm_type_y
432-
# assert z.usm_type == du.get_coerced_usm_type([usm_type_x, usm_type_y])
430+
assert x.usm_type == zx.usm_type == usm_type_x
431+
assert y.usm_type == zy.usm_type == usm_type_y
432+
assert z.usm_type == du.get_coerced_usm_type([usm_type_x, usm_type_y])
433433

434434

435-
# @pytest.mark.parametrize(
436-
# "op",
437-
# ["bitwise_and", "bitwise_or", "bitwise_xor", "left_shift", "right_shift"],
438-
# ids=[
439-
# "bitwise_and",
440-
# "bitwise_or",
441-
# "bitwise_xor",
442-
# "left_shift",
443-
# "right_shift",
444-
# ],
445-
# )
446-
# @pytest.mark.parametrize("usm_type_x", list_of_usm_types, ids=list_of_usm_types)
447-
# @pytest.mark.parametrize("usm_type_y", list_of_usm_types, ids=list_of_usm_types)
448-
# def test_coerced_usm_types_bitwise_op(op, usm_type_x, usm_type_y):
449-
# x = dp.arange(25, usm_type=usm_type_x)
450-
# y = dp.arange(25, usm_type=usm_type_y)[::-1]
435+
@pytest.mark.parametrize(
436+
"op",
437+
["bitwise_and", "bitwise_or", "bitwise_xor", "left_shift", "right_shift"],
438+
ids=[
439+
"bitwise_and",
440+
"bitwise_or",
441+
"bitwise_xor",
442+
"left_shift",
443+
"right_shift",
444+
],
445+
)
446+
@pytest.mark.parametrize("usm_type_x", list_of_usm_types, ids=list_of_usm_types)
447+
@pytest.mark.parametrize("usm_type_y", list_of_usm_types, ids=list_of_usm_types)
448+
def test_coerced_usm_types_bitwise_op(op, usm_type_x, usm_type_y):
449+
x = dp.arange(25, usm_type=usm_type_x)
450+
y = dp.arange(25, usm_type=usm_type_y)[::-1]
451451

452-
# z = getattr(dp, op)(x, y)
453-
# zx = getattr(dp, op)(x, 7)
454-
# zy = getattr(dp, op)(12, y)
452+
z = getattr(dp, op)(x, y)
453+
zx = getattr(dp, op)(x, 7)
454+
zy = getattr(dp, op)(12, y)
455455

456-
# assert x.usm_type == zx.usm_type == usm_type_x
457-
# assert y.usm_type == zy.usm_type == usm_type_y
458-
# assert z.usm_type == du.get_coerced_usm_type([usm_type_x, usm_type_y])
456+
assert x.usm_type == zx.usm_type == usm_type_x
457+
assert y.usm_type == zy.usm_type == usm_type_y
458+
assert z.usm_type == du.get_coerced_usm_type([usm_type_x, usm_type_y])
459459

460460

461461
# @pytest.mark.parametrize("usm_type_x", list_of_usm_types, ids=list_of_usm_types)

0 commit comments

Comments
 (0)