def METHOD_NAME(self, dtype, order):
    a = [-numpy.inf, 0., numpy.inf, numpy.nan]
    for xp in (numpy, cupy):
        if xp.issubdtype(dtype, xp.integer):
            error = OverflowError
        else:
            error = ValueError
        with pytest.raises(error):
            xp.asarray_chkfinite(a, dtype=dtype, order=order)