(self, fpeerr, flop, x, y)
| 627 | |
| 628 | class 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. |
no test coverage detected