From: Julian Gilbey <julian-git@d-and-j.net>
Date: Wed, 27 Apr 2022 13:40:05 +0100
Subject: Replace assert_array_equal by assert_allclose in tests to avoid
 floating point comparison failures

---
 PyMca5/tests/McaStackViewTest.py | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/PyMca5/tests/McaStackViewTest.py b/PyMca5/tests/McaStackViewTest.py
index 156a161..4f564bd 100644
--- a/PyMca5/tests/McaStackViewTest.py
+++ b/PyMca5/tests/McaStackViewTest.py
@@ -215,7 +215,7 @@ class testMcaStackView(unittest.TestCase):
             shape = range(6, 6+ndim)
             data = numpy.random.uniform(size=shape)
             self._assertFullView(data)
-    
+
     @unittest.skipIf(McaStackView is None,
                      'PyMca5.PyMcaCore.McaStackView cannot be imported')
     @unittest.skipIf(h5py is None,
@@ -274,14 +274,14 @@ class testMcaStackView(unittest.TestCase):
                     for (key, chunk), (addKey, add) in chunks:
                         chunk += add
                     for idxFullComplement in dataView.idxFullComplement:
-                        self.assert_array_equal(data[idxFullComplement],
-                                                         dataOrg[idxFullComplement])
+                        numpy.testing.assert_allclose(data[idxFullComplement],
+                                                      dataOrg[idxFullComplement])
                     if readonly:
-                        self.assert_array_equal(data[idxFull],
-                                                         dataOrg[idxFull])
+                        numpy.testing.assert_allclose(data[idxFull],
+                                                      dataOrg[idxFull])
                     else:
-                        self.assert_array_equal(data[idxFull],
-                                                         dataOrg[idxFull]+npAdd[idxFull])
+                        numpy.testing.assert_allclose(data[idxFull],
+                                                      dataOrg[idxFull]+npAdd[idxFull])
 
     def _assertMaskedView(self, data):
         mcaSlice = slice(2, -1)
@@ -316,14 +316,14 @@ class testMcaStackView(unittest.TestCase):
                     else:
                         _data = data
                     for idxFullComplement in dataView.idxFullComplement:
-                        self.assert_array_equal(_data[idxFullComplement],
-                                                         dataOrg[idxFullComplement])
+                        numpy.testing.assert_allclose(_data[idxFullComplement],
+                                                      dataOrg[idxFullComplement])
                     if readonly:
-                        self.assert_array_equal(_data[idxFull],
-                                                         dataOrg[idxFull])
+                        numpy.testing.assert_allclose(_data[idxFull],
+                                                      dataOrg[idxFull])
                     else:
-                        self.assert_array_equal(_data[idxFull],
-                                                         dataOrg[idxFull]+npAdd[idxFull])
+                        numpy.testing.assert_allclose(_data[idxFull],
+                                                      dataOrg[idxFull]+npAdd[idxFull])
 
     @contextmanager
     def h5Open(self, name):
