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

Function assert_raises_fpe

numpy/core/tests/test_half.py:9–17  ·  view source on GitHub ↗
(strmatch, callable, *args, **kwargs)

Source from the content-addressed store, hash-verified

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

Callers 1

test_half_fpeMethod · 0.85

Calls 2

assert_Function · 0.90
findMethod · 0.80

Tested by

no test coverage detected