@@ -136,13 +136,13 @@ def test_col_row_major(self):
136136 with self .assertRaises (RuntimeError ):
137137 xt .col_major_array (var )
138138
139- with self .assertRaises (RuntimeError ):
139+ with self .assertRaises (TypeError ):
140140 xt .row_major_tensor (var .T )
141141
142- with self .assertRaises (RuntimeError ):
142+ with self .assertRaises (TypeError ):
143143 xt .row_major_tensor (var [:, ::2 , ::2 ])
144144
145- with self .assertRaises (RuntimeError ):
145+ with self .assertRaises (TypeError ):
146146 # raise for wrong dimension
147147 xt .row_major_tensor (var [0 , 0 , :])
148148
@@ -158,6 +158,15 @@ def test_bad_argument_call(self):
158158 with self .assertRaises (TypeError ):
159159 xt .simple_tensor ("foo" )
160160
161+ def test_diff_shape_overload (self ):
162+ self .assertEqual (1 , xt .diff_shape_overload (np .ones (2 )))
163+ self .assertEqual (2 , xt .diff_shape_overload (np .ones ((2 , 2 ))))
164+
165+ with self .assertRaises (TypeError ):
166+ # FIXME: the TypeError information is not informative
167+ xt .diff_shape_overload (np .ones ((2 , 2 , 2 )))
168+
169+
161170class AttributeTest (TestCase ):
162171
163172 def setUp (self ):
0 commit comments