def test_union_infinite(): class A: def __next__(self): return self def __iter__(self): return self msg = r"union\(\) expects a list or sequence of Frames, but " \ r"got an argument of type <class '.*\.A'>" with pytest.raises(TypeError, match=msg): dt.union(A())
def test_union3(): dt1 = dt.Frame([2, 5, 7, 2, 3]) dt2 = dt.Frame([3, 4, 2, 5]) dt3 = dt.Frame([0, 3, 2, 2, 2, 2, 2, 2, 0]) res = dt.union(dt3, dt1, dt2) assert res.to_list() == [[0, 2, 3, 4, 5, 7]] frame_integrity_check(res)
def test_union_badargs(): msg = (r"union\(\) expects a list or sequence of Frames, but got an " r"argument of type <class 'str'>") with pytest.raises(TypeError, match=msg): dt.union('a')