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

Method test_fancy

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

Source from the content-addressed store, hash-verified

874 self._check_inverse_of_slicing(s)
875
876 def test_fancy(self):
877 self._check_inverse_of_slicing(np.array([[0, 1], [2, 1]]))
878 with pytest.raises(IndexError):
879 delete(self.a, [100])
880 with pytest.raises(IndexError):
881 delete(self.a, [-100])
882
883 self._check_inverse_of_slicing([0, -1, 2, 2])
884
885 self._check_inverse_of_slicing([True, False, False, True, False])
886
887 # not legal, indexing with these would change the dimension
888 with pytest.raises(ValueError):
889 delete(self.a, True)
890 with pytest.raises(ValueError):
891 delete(self.a, False)
892
893 # not enough items
894 with pytest.raises(ValueError):
895 delete(self.a, [False]*4)
896
897 def test_single(self):
898 self._check_inverse_of_slicing(0)

Callers

nothing calls this directly

Calls 2

deleteFunction · 0.90

Tested by

no test coverage detected