示例#1
0
def test_invalid_tensor_construction():
    with pytest.raises(TypeError):
        pa.Tensor()
示例#2
0
def test_invalid_tensor_operation():
    t = pa.Tensor()
    with pytest.raises(TypeError):
        t.to_numpy()
示例#3
0
def test_invalid_tensor_constructor_repr():
    # ARROW-2638: prevent calling extension class constructors directly
    with pytest.raises(TypeError):
        repr(pa.Tensor([1]))
示例#4
0
def test_invalid_tensor_constructor_repr():
    t = pa.Tensor([1])
    assert repr(t) == '<invalid pyarrow.Tensor>'