@@ -675,18 +675,18 @@ def test_empty(self):
675675 self .assertEqual (nd .type_of (a ), ndt .type ('var * int32' ))
676676 self .assertEqual (nd .as_py (a ), [])
677677
678- # class TestConstructErrors(unittest.TestCase):
679- # def test_bad_params(self):
680- # self.assertRaises(ValueError , nd.array, type='int32')
681- # self.assertRaises(ValueError , nd.array, type='2 * 2 * int32')
682- # self.assertRaises(ValueError, nd.array, access='readwrite')
683-
684- # def test_dict_auto_detect(self):
685- # # Trigger failure in initial auto detect pass
686- # self.assertRaises(ValueError, nd.array, {'x' : 1})
687- # self.assertRaises(ValueError, nd.array, [{'x' : 1}])
688- # # Trigger failure in later type promotion
689- # self.assertRaises(ValueError, nd.array, [['a'], {'x' : 1}])
678+ class TestConstructErrors (unittest .TestCase ):
679+ def test_bad_params (self ):
680+ self .assertRaises (TypeError , nd .array , type = 'int32' )
681+ self .assertRaises (TypeError , nd .array , type = '2 * 2 * int32' )
682+
683+ def test_dict_auto_detect ( self ):
684+ # Trigger failure in initial auto detect pass
685+ self . assertRaises ( ValueError , nd . array , { 'x' : 1 })
686+ self .assertRaises (ValueError , nd .array , [ {'x' : 1 }] )
687+ # Trigger failure in later type promotion
688+ # TODO: fix
689+ # self.assertRaises(ValueError, nd.array, [['a'], {'x' : 1}])
690690
691691class TestOptionArrayConstruct (unittest .TestCase ):
692692 def check_scalars (self , type , input_expected ):
0 commit comments