MCPcopy
hub / github.com/dask/dask / test_method_caller

Function test_method_caller

dask/tests/test_utils.py:277–287  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

275
276
277def test_method_caller():
278 a = [1, 2, 3, 3, 3]
279 f = methodcaller("count")
280 assert f(a, 3) == a.count(3)
281 assert methodcaller("count") is f
282 assert M.count is f
283 assert pickle.loads(pickle.dumps(f)) is f
284 assert "count" in dir(M)
285
286 assert "count" in str(methodcaller("count"))
287 assert "count" in repr(methodcaller("count"))
288
289
290def test_skip_doctest():

Callers

nothing calls this directly

Calls 3

methodcallerClass · 0.90
fFunction · 0.70
countMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…