MCPcopy
hub / github.com/numpy/numpy / assert_raises_fpe

Method assert_raises_fpe

numpy/_core/tests/test_numeric.py:958–966  ·  view source on GitHub ↗
(self, fpeerr, flop, x, y)

Source from the content-addressed store, hash-verified

956
957class TestFloatExceptions:
958 def assert_raises_fpe(self, fpeerr, flop, x, y):
959 ftype = type(x)
960 try:
961 flop(x, y)
962 assert_(False,
963 f"Type {ftype} did not raise fpe error '{fpeerr}'.")
964 except FloatingPointError as exc:
965 assert_(str(exc).find(fpeerr) >= 0,
966 f"Type {ftype} raised wrong fpe error '{exc}'.")
967
968 def assert_op_raises_fpe(self, fpeerr, flop, sc1, sc2):
969 # 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