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

Method test_invalid_nesting

numpy/_core/tests/test_shape_base.py:814–824  ·  view source on GitHub ↗
(self, block)

Source from the content-addressed store, hash-verified

812 assert_equal(block(np.eye(3)), np.eye(3))
813
814 def test_invalid_nesting(self, block):
815 msg = 'depths are mismatched'
816 assert_raises_regex(ValueError, msg, block, [1, [2]])
817 assert_raises_regex(ValueError, msg, block, [1, []])
818 assert_raises_regex(ValueError, msg, block, [[1], 2])
819 assert_raises_regex(ValueError, msg, block, [[], 2])
820 assert_raises_regex(ValueError, msg, block, [
821 [[1], [2]],
822 [[3, 4]],
823 [5] # missing brackets
824 ])
825
826 def test_empty_lists(self, block):
827 assert_raises_regex(ValueError, 'empty', block, [])

Callers

nothing calls this directly

Calls 1

assert_raises_regexFunction · 0.90

Tested by

no test coverage detected