def test_basic(self, func_name, ndim, keepdims):
        """This test inserts a NaN in the array and checks if the
        output from cuPyNumeric and numpy match
        """
        shape = (5,) * ndim
        size = prod(shape)
        in_np = np.random.random(shape)

        # set an element to nan
        index_nan = np.random.randint(low=0, high=size)
        index_nan = np.unravel_index(index_nan, shape)
        in_num = num.array(in_np)
        in_num[index_nan] = num.nan
        in_np[index_nan] = np.nan

        func_np = getattr(np, func_name)
        func_num = getattr(num, func_name)

        # make sure numpy and cupynumeric give the same out array and max val
        out_np = np.unravel_index(func_np(in_np, keepdims=keepdims), shape)
        out_num = np.unravel_index(func_num(in_num, keepdims=keepdims), shape)

        index_array_np = in_np[out_np]
        index_array_num = in_num[out_num]

        assert np.array_equal(out_num, out_np)
        assert np.array_equal(index_array_num, index_array_np)
This test inserts a NaN in the array and checks if the
        output from cuPyNumeric and numpy match
        
tests/integration/test_nanarg_reduction.py