Skip to content

Commit 3a6990a

Browse files
Fix changes after black
1 parent 9d3b3b9 commit 3a6990a

File tree

1 file changed

+38
-14
lines changed

1 file changed

+38
-14
lines changed

tests/test_arraycreation.py

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -269,32 +269,43 @@ def test_tri_default_dtype():
269269

270270
@pytest.mark.parametrize(
271271
"k",
272-
[-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6],
273-
ids=["-6", "-5", "-4", "-3", "-2", "-1", "0", "1", "2", "3", "4", "5", "6"],
272+
[-3, -2, -1, 0, 1, 2, 3, 4, 5, numpy.array(1), dpnp.array(2), dpt.asarray(3)],
273+
ids=[
274+
"-3",
275+
"-2",
276+
"-1",
277+
"0",
278+
"1",
279+
"2",
280+
"3",
281+
"4",
282+
"5",
283+
"np.array(1)",
284+
"dpnp.array(2)",
285+
"dpt.asarray(3)",
286+
],
274287
)
275288
@pytest.mark.parametrize(
276289
"m",
277290
[
278-
[0, 1, 2, 3, 4],
279-
[1, 1, 1, 1, 1],
280291
[[0, 0], [0, 0]],
281292
[[1, 2], [1, 2]],
282293
[[1, 2], [3, 4]],
283294
[[0, 1, 2], [3, 4, 5], [6, 7, 8]],
284295
[[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]],
285296
],
286297
ids=[
287-
"[0, 1, 2, 3, 4]",
288-
"[1, 1, 1, 1, 1]",
289298
"[[0, 0], [0, 0]]",
290299
"[[1, 2], [1, 2]]",
291300
"[[1, 2], [3, 4]]",
292301
"[[0, 1, 2], [3, 4, 5], [6, 7, 8]]",
293302
"[[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]",
294303
],
295304
)
296-
def test_tril(m, k):
297-
a = numpy.array(m)
305+
@pytest.mark.usefixtures("allow_fall_back_on_numpy")
306+
@pytest.mark.parametrize("dtype", get_all_dtypes(no_float16=False))
307+
def test_tril(m, k, dtype):
308+
a = numpy.array(m, dtype=dtype)
298309
ia = dpnp.array(a)
299310
expected = numpy.tril(a, k=k)
300311
result = dpnp.tril(ia, k=k)
@@ -303,26 +314,39 @@ def test_tril(m, k):
303314

304315
@pytest.mark.parametrize(
305316
"k",
306-
[-4, -3, -2, -1, 0, 1, 2, 3, 4],
307-
ids=["-4", "-3", "-2", "-1", "0", "1", "2", "3", "4"],
317+
[-3, -2, -1, 0, 1, 2, 3, 4, 5, numpy.array(1), dpnp.array(2), dpt.asarray(3)],
318+
ids=[
319+
"-3",
320+
"-2",
321+
"-1",
322+
"0",
323+
"1",
324+
"2",
325+
"3",
326+
"4",
327+
"5",
328+
"np.array(1)",
329+
"dpnp.array(2)",
330+
"dpt.asarray(3)",
331+
],
308332
)
309333
@pytest.mark.parametrize(
310334
"m",
311335
[
312-
[0, 1, 2, 3, 4],
313336
[[1, 2], [3, 4]],
314337
[[0, 1, 2], [3, 4, 5], [6, 7, 8]],
315338
[[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]],
316339
],
317340
ids=[
318-
"[0, 1, 2, 3, 4]",
319341
"[[1, 2], [3, 4]]",
320342
"[[0, 1, 2], [3, 4, 5], [6, 7, 8]]",
321343
"[[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]",
322344
],
323345
)
324-
def test_triu(m, k):
325-
a = numpy.array(m)
346+
@pytest.mark.usefixtures("allow_fall_back_on_numpy")
347+
@pytest.mark.parametrize("dtype", get_all_dtypes(no_float16=False))
348+
def test_triu(m, k, dtype):
349+
a = numpy.array(m, dtype=dtype)
326350
ia = dpnp.array(a)
327351
expected = numpy.triu(a, k=k)
328352
result = dpnp.triu(ia, k=k)

0 commit comments

Comments
 (0)