Skip to content

Commit 5893524

Browse files
committed
fix issues
1 parent c2a976b commit 5893524

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

dpnp/tests/helper.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ def get_all_dtypes(
198198
no_float16=True,
199199
no_complex=False,
200200
no_none=False,
201+
xfail_dtypes=None,
202+
exclude=None,
201203
no_unsigned=False,
202204
device=None,
203205
):
@@ -225,6 +227,17 @@ def get_all_dtypes(
225227
if not no_none:
226228
dtypes.append(None)
227229

230+
def mark_xfail(dtype):
231+
if xfail_dtypes is not None and dtype in xfail_dtypes:
232+
return pytest.param(dtype, marks=pytest.mark.xfail)
233+
return dtype
234+
235+
def not_excluded(dtype):
236+
if exclude is None:
237+
return True
238+
return dtype not in exclude
239+
240+
dtypes = [mark_xfail(dtype) for dtype in dtypes if not_excluded(dtype)]
228241
return dtypes
229242

230243

dpnp/tests/test_histogram.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
get_float_complex_dtypes,
2020
get_float_dtypes,
2121
get_integer_dtypes,
22+
get_integer_float_dtypes,
2223
has_support_aspect64,
2324
numpy_version,
2425
)

dpnp/tests/test_linalg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
get_all_dtypes,
2323
get_complex_dtypes,
2424
get_float_complex_dtypes,
25+
get_integer_float_dtypes,
2526
has_support_aspect64,
2627
is_cpu_device,
2728
is_cuda_device,

dpnp/tests/test_logic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
get_all_dtypes,
99
get_float_complex_dtypes,
1010
get_float_dtypes,
11+
get_integer_float_dtypes,
1112
)
1213

1314

dpnp/tests/test_mathematical.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2403,7 +2403,7 @@ def test_basic(self, dtype, axis, keepdims):
24032403

24042404
assert_dtype_allclose(res, exp)
24052405

2406-
@pytest.mark.parametrize("in_dtype", get_integer_float_dtypes())
2406+
@pytest.mark.parametrize("in_dt", get_integer_float_dtypes())
24072407
@pytest.mark.parametrize("dt", get_all_dtypes(no_bool=True))
24082408
def test_dtype(self, in_dt, dt):
24092409
a = dpnp.ones(99, dtype=in_dt)

0 commit comments

Comments
 (0)