Skip to content

Commit b6e64e7

Browse files
Uncomment some tests checking for proper error handling when
constructing arrays.
1 parent 061ff36 commit b6e64e7

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

dynd/nd/test/test_array_construct.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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

691691
class TestOptionArrayConstruct(unittest.TestCase):
692692
def check_scalars(self, type, input_expected):

0 commit comments

Comments
 (0)