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

Function test_block_dispatcher

numpy/core/tests/test_shape_base.py:814–825  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

812
813
814def test_block_dispatcher():
815 class ArrayLike:
816 pass
817 a = ArrayLike()
818 b = ArrayLike()
819 c = ArrayLike()
820 assert_equal(list(_block_dispatcher(a)), [a])
821 assert_equal(list(_block_dispatcher([a])), [a])
822 assert_equal(list(_block_dispatcher([a, b])), [a, b])
823 assert_equal(list(_block_dispatcher([[a], [b, [c]]])), [a, b, c])
824 # don't recurse into non-lists
825 assert_equal(list(_block_dispatcher((a, b))), [(a, b)])

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
_block_dispatcherFunction · 0.90
ArrayLikeClass · 0.70

Tested by

no test coverage detected