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

Method assert_raises_fpe

numpy/core/tests/test_numeric.py:629–637  ·  view source on GitHub ↗
(self, fpeerr, flop, x, y)

Source from the content-addressed store, hash-verified

627
628class TestFloatExceptions:
629 def assert_raises_fpe(self, fpeerr, flop, x, y):
630 ftype = type(x)
631 try:
632 flop(x, y)
633 assert_(False,
634 "Type %s did not raise fpe error '%s'." % (ftype, fpeerr))
635 except FloatingPointError as exc:
636 assert_(str(exc).find(fpeerr) >= 0,
637 "Type %s raised wrong fpe error '%s'." % (ftype, exc))
638
639 def assert_op_raises_fpe(self, fpeerr, flop, sc1, sc2):
640 # Check that fpe exception is raised.

Callers 2

assert_op_raises_fpeMethod · 0.95

Calls 2

assert_Function · 0.90
findMethod · 0.80

Tested by

no test coverage detected