def METHOD_NAME(input_type, sparse_format, dtype, convert_format):
    rand_func = cupyx.scipy.sparse if input_type == "cupy" else scipy_sparse
    X = rand_func.random(
        100, 100, format=sparse_format, density=0.5, dtype=dtype
    )
    if convert_format or sparse_format == "csr":
        X_m = SparseCumlArray(X, convert_format=convert_format)
        assert X.shape == X_m.shape
        assert X.nnz == X_m.nnz
        assert X.dtype == X_m.dtype
        # Just a sanity check
        assert isinstance(X_m.indptr, CumlArray)
        assert isinstance(X_m.indices, CumlArray)
        assert isinstance(X_m.data, CumlArray)
        assert X_m.indptr.dtype == cp.int32
        assert X_m.indices.dtype == cp.int32
        assert X_m.data.dtype == dtype
    elif not convert_format:
        with pytest.raises(ValueError):
            SparseCumlArray(X, convert_format=convert_format)