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

Method test_trim_arg

numpy/lib/tests/test_function_base.py:1499–1506  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1497 assert_array_equal(res, np.zeros((0,) * ndim))
1498
1499 def test_trim_arg(self):
1500 a = np.array([0, 1, 2, 0])
1501
1502 res = trim_zeros(a, trim='f')
1503 assert_array_equal(res, [1, 2, 0])
1504
1505 res = trim_zeros(a, trim='b')
1506 assert_array_equal(res, [0, 1, 2])
1507
1508 @pytest.mark.parametrize("trim", ("front", ""))
1509 def test_unexpected_trim_value(self, trim):

Callers

nothing calls this directly

Calls 2

trim_zerosFunction · 0.90
assert_array_equalFunction · 0.90

Tested by

no test coverage detected