from __future__ import division, absolute_import, print_function

import platform
import pytest

import numpy as np
from numpy import uint16, float16, float32, float64
from numpy.testing import assert_, assert_equal


def assert_raises_fpe(strmatch, callable, *args, **kwargs):
    try:
        callable(*args, **kwargs)
    except FloatingPointError as exc:
        assert_(str(exc).find(strmatch) >= 0,
                "Did not raise floating point %s error" % strmatch)