Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions test_python/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,7 @@ PYBIND11_MODULE(xtensor_python_test, m)
[](C & self) -> C::array_type & { return self.array(); }
)
;

m.def("simple_array", [](xt::pyarray<int>) { return 1; } );
m.def("simple_tensor", [](xt::pytensor<int, 1>) { return 2; } );
}
7 changes: 7 additions & 0 deletions test_python/test_pyarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ def test_col_row_major(self):
xt.col_major_array(varF)
xt.col_major_array(varF[:, :, 0]) # still col major!

def test_bad_argument_call(self):
with self.assertRaises(TypeError):
xt.simple_array("foo")

with self.assertRaises(TypeError):
xt.simple_tensor("foo")

class AttributeTest(TestCase):

def setUp(self):
Expand Down