MCPcopy Create free account
hub / github.com/dask/dask / test_method_caller

Function test_method_caller

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

Source from the content-addressed store, hash-verified

274
275
276def test_method_caller():
277 a = [1, 2, 3, 3, 3]
278 f = methodcaller("count")
279 assert f(a, 3) == a.count(3)
280 assert methodcaller("count") is f
281 assert M.count is f
282 assert pickle.loads(pickle.dumps(f)) is f
283 assert "count" in dir(M)
284
285 assert "count" in str(methodcaller("count"))
286 assert "count" in repr(methodcaller("count"))
287
288
289def 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