def METHOD_NAME(self, desired, actual, diff_allowed=2):
    """ Only use for small arrays. """
    try:
        # cast up so math doesn't underflow
        diff = abs(
            ravel(actual.astype(Int32)) - ravel(desired.astype(Int32))
        )
        assert (diff <= diff_allowed).all()
    except AssertionError:
        size = sum(array(desired.shape))
        if size < 10:
            msg = "\n"
            msg += "desired: %s\n" % ravel(desired)
            msg += "actual: %s\n" % ravel(actual)
            msg += "abs diff: %s\n" % diff
        else:
            msg = "size: %d.  To large to display" % size
        raise AssertionError(msg)