MCPcopy Create free account
hub / github.com/numpy/numpy / test_zerosize_reduction

Method test_zerosize_reduction

numpy/core/tests/test_ufunc.py:1462–1470  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1460 np.add.reduceat([1, None, 2], [0, 2])
1461
1462 def test_zerosize_reduction(self):
1463 # Test with default dtype and object dtype
1464 for a in [[], np.array([], dtype=object)]:
1465 assert_equal(np.sum(a), 0)
1466 assert_equal(np.prod(a), 1)
1467 assert_equal(np.any(a), False)
1468 assert_equal(np.all(a), True)
1469 assert_raises(ValueError, np.max, a)
1470 assert_raises(ValueError, np.min, a)
1471
1472 def test_axis_out_of_bounds(self):
1473 a = np.array([False, False])

Callers

nothing calls this directly

Calls 6

assert_equalFunction · 0.90
assert_raisesFunction · 0.90
sumMethod · 0.45
prodMethod · 0.45
anyMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected