| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -239,4 +239,7 @@ PYBIND11_MODULE(xtensor_python_test, m) | |||
| 239 | 239 | [](C & self) -> C::array_type & { return self.array(); } | |
| 240 | 240 | ) | |
| 241 | 241 | ; | |
| 242 | + | ||
| 243 | + m.def("simple_array", [](xt::pyarray<int>) { return 1; } ); | ||
| 244 | + m.def("simple_tensor", [](xt::pytensor<int, 1>) { return 2; } ); | ||
| 242 | 245 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -147,6 +147,13 @@ def test_col_row_major(self): | |||
| 147 | 147 | xt.col_major_array(varF) | |
| 148 | 148 | xt.col_major_array(varF[:, :, 0]) # still col major! | |
| 149 | 149 | ||
| 150 | + def test_bad_argument_call(self): | ||
| 151 | + with self.assertRaises(TypeError): | ||
| 152 | + xt.simple_array("foo") | ||
| 153 | + | ||
| 154 | + with self.assertRaises(TypeError): | ||
| 155 | + xt.simple_tensor("foo") | ||
| 156 | + | ||
| 150 | 157 | class AttributeTest(TestCase): | |
| 151 | 158 | ||
| 152 | 159 | def setUp(self): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments