8000 MAINT: improve coverage of slow path by using a user-defined dtype · numpy/numpy@217e2a7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 217e2a7

Browse files
committed
MAINT: improve coverage of slow path by using a user-defined dtype
1 parent af52e19 commit 217e2a7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

numpy/core/tests/test_ufunc.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1923,12 +1923,19 @@ def __rmul__(self, other):
19231923
assert_(MyThing.rmul_count == 1, MyThing.rmul_count)
19241924
assert_(MyThing.getitem_count <= 2, MyThing.getitem_count)
19251925

1926-
def test_inplace_fancy_indexing(self):
1926+
@pytest.mark.parametrize("a", (
1927+
np.arange(10, dtype=int),
1928+
np.arange(10, dtype=_rational_tests.rational),
19271929
1928-
a = np.arange(10)
1930+
))
1931+
def test_inplace_fancy_indexing(self, a):
19291932
np.add.at(a, [2, 5, 2], 1)
19301933
assert_equal(a, [0, 1, 4, 3, 4, 6, 6, 7, 8, 9])
19311934

1935+
np.negative.at(a, [2, 5, 3])
1936+
assert_equal(a, [0, 1, -4, -3, 4, -6, 6, 7, 8, 9])
1937+
1938+
# reset a
19321939
a = np.arange(10)
19331940
b = np.array([100, 100, 100])
19341941
np.add.at(a, [2, 5, 2], b)

0 commit comments

Comments
 (0)
0