@@ -135,13 +135,13 @@ def test_col_row_major(self):
135135 with self .assertRaises (RuntimeError ):
136136 xt .col_major_array (var )
137137
138- with self .assertRaises (RuntimeError ):
138+ with self .assertRaises (TypeError ):
139139 xt .row_major_tensor (var .T )
140140
141- with self .assertRaises (RuntimeError ):
141+ with self .assertRaises (TypeError ):
142142 xt .row_major_tensor (var [:, ::2 , ::2 ])
143143
144- with self .assertRaises (RuntimeError ):
144+ with self .assertRaises (TypeError ):
145145 # raise for wrong dimension
146146 xt .row_major_tensor (var [0 , 0 , :])
147147
@@ -157,6 +157,15 @@ def test_bad_argument_call(self):
157157 with self .assertRaises (TypeError ):
158158 xt .simple_tensor ("foo" )
159159
160+ def test_diff_shape_overload (self ):
161+ self .assertEqual (1 , xt .diff_shape_overload (np .ones (2 )))
162+ self .assertEqual (2 , xt .diff_shape_overload (np .ones ((2 , 2 ))))
163+
164+ with self .assertRaises (TypeError ):
165+ # FIXME: the TypeError information is not informative
166+ xt .diff_shape_overload (np .ones ((2 , 2 , 2 )))
167+
168+
160169class AttributeTest (TestCase ):
161170
162171 def setUp (self ):
0 commit comments