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

Method test_fancy

numpy/lib/tests/test_function_base.py:1013–1033  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1011 self._check_inverse_of_slicing(s)
1012
1013 def test_fancy(self):
1014 a, _ = self._create_arrays()
1015 self._check_inverse_of_slicing(np.array([[0, 1], [2, 1]]))
1016 with pytest.raises(IndexError):
1017 delete(a, [100])
1018 with pytest.raises(IndexError):
1019 delete(a, [-100])
1020
1021 self._check_inverse_of_slicing([0, -1, 2, 2])
1022
1023 self._check_inverse_of_slicing([True, False, False, True, False])
1024
1025 # not legal, indexing with these would change the dimension
1026 with pytest.raises(ValueError):
1027 delete(a, True)
1028 with pytest.raises(ValueError):
1029 delete(a, False)
1030
1031 # not enough items
1032 with pytest.raises(ValueError):
1033 delete(a, [False] * 4)
1034
1035 def test_single(self):
1036 self._check_inverse_of_slicing(0)

Callers

nothing calls this directly

Calls 3

_create_arraysMethod · 0.95
deleteFunction · 0.90

Tested by

no test coverage detected