def test_basic_nan_min_max(self, func_name, ndim, keepdims):
        """This test sets an element to NaN 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)

        out_np = func_np(in_np, keepdims=keepdims)
        out_num = func_num(in_num, keepdims=keepdims)

        assert np.array_equal(out_num, out_np)
This test sets an element to NaN and checks if the output
        from cuPyNumeric and numpy match.
tests/integration/test_nan_reduction.py