diff --git a/test_python/main.cpp b/test_python/main.cpp index 2258ff6..a9ddc04 100644 --- a/test_python/main.cpp +++ b/test_python/main.cpp @@ -239,4 +239,7 @@ PYBIND11_MODULE(xtensor_python_test, m) [](C & self) -> C::array_type & { return self.array(); } ) ; + + m.def("simple_array", [](xt::pyarray) { return 1; } ); + m.def("simple_tensor", [](xt::pytensor) { return 2; } ); } diff --git a/test_python/test_pyarray.py b/test_python/test_pyarray.py index b72f28d..e96b6dc 100644 --- a/test_python/test_pyarray.py +++ b/test_python/test_pyarray.py @@ -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):