def test_check_collection_array_of_list(): X = np.array([list(range(2)), list(range(3))], dtype=object) with pytest.raises(ValueError): check_collection(X)
def test_check_collection_list_of_list(): X = [list(range(2)), list(range(3))] Xnew = check_collection(X) assert np.array_equal(np.array(X[0]), Xnew[0])
def test_check_collection_ragged_array(): X = np.array([np.arange(2), np.arange(3)], dtype=object) with pytest.raises(ValueError): check_collection(X)