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

Method test_invalid_nesting

numpy/core/tests/test_shape_base.py:740–750  ·  view source on GitHub ↗
(self, block)

Source from the content-addressed store, hash-verified

738 assert_equal(block(np.eye(3)), np.eye(3))
739
740 def test_invalid_nesting(self, block):
741 msg = 'depths are mismatched'
742 assert_raises_regex(ValueError, msg, block, [1, [2]])
743 assert_raises_regex(ValueError, msg, block, [1, []])
744 assert_raises_regex(ValueError, msg, block, [[1], 2])
745 assert_raises_regex(ValueError, msg, block, [[], 2])
746 assert_raises_regex(ValueError, msg, block, [
747 [[1], [2]],
748 [[3, 4]],
749 [5] # missing brackets
750 ])
751
752 def test_empty_lists(self, block):
753 assert_raises_regex(ValueError, 'empty', block, [])

Callers

nothing calls this directly

Calls 1

assert_raises_regexFunction · 0.90

Tested by

no test coverage detected