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

Method test_exception_handling

numpy/core/tests/test_overrides.py:681–688  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

679 assert array_like.function is self.MyArray.fromfile
680
681 def test_exception_handling(self):
682 self.add_method('array', self.MyArray, enable_value_error=True)
683
684 ref = self.MyArray.array()
685
686 with assert_raises(TypeError):
687 # Raises the error about `value_error` being invalid first
688 np.array(1, value_error=True, like=ref)
689
690 @pytest.mark.parametrize('function, args, kwargs', _array_tests)
691 def test_like_as_none(self, function, args, kwargs):

Callers

nothing calls this directly

Calls 2

add_methodMethod · 0.95
assert_raisesFunction · 0.90

Tested by

no test coverage detected