Blob Blame History Raw
From 46fa2f07c00613ed6b647b2cf44e388f547fe668 Mon Sep 17 00:00:00 2001
From: Antonio Valentino <antonio.valentino@tiscali.it>
Date: Tue, 1 Jan 2019 12:31:34 +0100
Subject: [PATCH] Check for the correct exception types (numpy 1.16 compat)

---
 tables/tests/test_array.py | 2 +-
 tables/tests/test_lists.py | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tables/tests/test_array.py b/tables/tests/test_array.py
index b7d6a3f5..563c7662 100644
--- a/tables/tests/test_array.py
+++ b/tables/tests/test_array.py
@@ -2005,7 +2005,7 @@ def test(self):
         """Test for creation of non-homogeneous arrays."""
 
         # This checks ticket #12.
-        self.assertRaises(ValueError,
+        self.assertRaises((ValueError, TypeError),
                           self.h5file.create_array, '/', 'test', [1, [2, 3]])
         self.assertRaises(NoSuchNodeError, self.h5file.remove_node, '/test')
 
diff --git a/tables/tests/test_lists.py b/tables/tests/test_lists.py
index 9cf83fec..9e79130a 100644
--- a/tables/tests/test_lists.py
+++ b/tables/tests/test_lists.py
@@ -144,14 +144,14 @@ def test00_char(self):
             print('\n', '-=' * 30)
             print("Running test for %s" % (self.title))
         a = self.charList
-        with self.assertRaises(ValueError):
+        with self.assertRaises((ValueError, TypeError)):
             WriteRead(self.h5fname, a)
 
     def test01_types(self):
         """Non supported lists object (numerical types)"""
 
         a = self.numericalList
-        with self.assertRaises(ValueError):
+        with self.assertRaises((ValueError, TypeError)):
             WriteRead(self.h5fname, a)