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

Function assert_raises_fpe

numpy/_core/tests/test_half.py:10–18  ·  view source on GitHub ↗
(strmatch, callable, *args, **kwargs)

Source from the content-addressed store, hash-verified

8
9
10def assert_raises_fpe(strmatch, callable, *args, **kwargs):
11 try:
12 callable(*args, **kwargs)
13 except FloatingPointError as exc:
14 assert_(str(exc).find(strmatch) >= 0,
15 f"Did not raise floating point {strmatch} error")
16 else:
17 assert_(False,
18 f"Did not raise floating point {strmatch} error")
19
20class TestHalf:
21 def _create_arrays_all(self):

Callers 1

test_half_fpeMethod · 0.85

Calls 2

assert_Function · 0.90
findMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…