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