MCPcopy Index your code
hub / github.com/numpy/numpy / test_endswith

Method test_endswith

numpy/_core/tests/test_defchararray.py:259–268  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

257 assert_array_equal(B.count('123'), [[0, 0], [1, 0], [1, 0]])
258
259 def test_endswith(self):
260 A = self.A()
261 assert_(issubclass(A.endswith('').dtype.type, np.bool))
262 assert_array_equal(A.endswith(' '), [[1, 0], [0, 0], [1, 0]])
263 assert_array_equal(A.endswith('3', 0, 3), [[0, 0], [1, 0], [1, 0]])
264
265 def fail():
266 A.endswith('3', 'fdjk')
267
268 assert_raises(TypeError, fail)
269
270 @pytest.mark.parametrize(
271 "dtype, encode",

Callers

nothing calls this directly

Calls 5

AMethod · 0.95
assert_Function · 0.90
assert_array_equalFunction · 0.90
assert_raisesFunction · 0.90
endswithMethod · 0.80

Tested by

no test coverage detected