1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
Index: h5py/h5py/tests/test_selections.py
===================================================================
--- h5py.orig/h5py/tests/test_selections.py 2023-07-10 23:43:42.871538460 +0200
+++ h5py/h5py/tests/test_selections.py 2023-07-10 23:48:11.149946793 +0200
@@ -103,11 +103,15 @@
# args is list, return a FancySelection
st = sel.select((10,), list([1,2,3]), dset)
- self.assertIsInstance(st, sel.FancySelection)
+ #self.assertIsInstance(st, sel.FancySelection)
+ # Debian pushes classes into submodules _debian_h5py_serial or _debian_h5py_mpi
+ # so assertIsInstance does not recognize that h5py._debian_h5py_serial._hl.selections.FancySelection
+ # is h5py._hl.selections.FancySelection. Hence check by type name instead.
+ self.assertEqual(type(st).__name__, sel.FancySelection.__name__)
# args[0] is tuple, return a FancySelection
st = sel.select((10,), ((1, 2, 3),), dset)
- self.assertIsInstance(st, sel.FancySelection)
+ self.assertEqual(type(st).__name__, sel.FancySelection.__name__)
# args is a Boolean mask, return a PointSelection
st1 = sel.select((5,), np.array([True,False,False,False,True]), dset)
@@ -115,7 +119,8 @@
# args is int, return a SimpleSelection
st2 = sel.select((10,), 1, dset)
- self.assertIsInstance(st2, sel.SimpleSelection)
+ #self.assertIsInstance(st2, sel.SimpleSelection)
+ self.assertEqual(type(st2).__name__, 'SimpleSelection')
# args is str, should be rejected
with self.assertRaises(TypeError):
|