Skip to content

Commit 2dc1e07

Browse files
committed
Rename tests
1 parent 8c1d5ca commit 2dc1e07

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/test_funcs.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def test_dims_and_classes(self, xp: ModuleType, n_dim: int, num_classes: int):
467467
i = tuple(i_list)
468468
assert y[*i, j] == (x[i] == j)
469469

470-
def test_one_hot(self, xp: ModuleType):
470+
def test_basic(self, xp: ModuleType):
471471
actual = one_hot(xp.asarray([0, 1, 2]), 3)
472472
expected = xp.asarray([[1., 0., 0.],
473473
[0., 1., 0.],
@@ -480,7 +480,7 @@ def test_one_hot(self, xp: ModuleType):
480480
[1., 0., 0.]])
481481
xp_assert_equal(actual, expected)
482482

483-
def test_one_hot_out_of_bound(self, xp: ModuleType):
483+
def test_out_of_bound(self, xp: ModuleType):
484484
# Undefined behavior. Either return zero, or raise.
485485
try:
486486
actual = one_hot(xp.asarray([-1, 3]), 3)
@@ -490,14 +490,14 @@ def test_one_hot_out_of_bound(self, xp: ModuleType):
490490
[0., 0., 0.]])
491491
xp_assert_equal(actual, expected)
492492

493-
def test_one_hot_custom_dtype(self, xp: ModuleType):
493+
def test_custom_dtype(self, xp: ModuleType):
494494
actual = one_hot(xp.asarray([0, 1, 2]), 3, dtype=xp.bool)
495495
expected = xp.asarray([[True, False, False],
496496
[False, True, False],
497497
[False, False, True]])
498498
xp_assert_equal(actual, expected)
499499

500-
def test_one_hot_axis(self, xp: ModuleType):
500+
def test_axis(self, xp: ModuleType):
501501
expected = xp.asarray([[0., 1., 0.],
502502
[0., 0., 1.],
503503
[1., 0., 0.]]).T
@@ -507,7 +507,7 @@ def test_one_hot_axis(self, xp: ModuleType):
507507
actual = one_hot(xp.asarray([1, 2, 0]), 3, axis=-2)
508508
xp_assert_equal(actual, expected)
509509

510-
def test_one_hot_non_integer(self, xp: ModuleType):
510+
def test_non_integer(self, xp: ModuleType):
511511
with pytest.raises((TypeError, RuntimeError, IndexError, DeprecationWarning)):
512512
one_hot(xp.asarray([1.0]), 3)
513513

0 commit comments

Comments
 (0)