From 777ce9a5a8de8fd89bdc9765594ca30eeadd98c2 Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Thu, 12 Dec 2019 15:00:52 +0000
Subject: [PATCH] TEST: Adjust image save test. Was I testing the wrong
 reference here? I have no idea

---
 tests/test_image.py | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/tests/test_image.py b/tests/test_image.py
index 9686f8739..e12c6acb7 100644
--- a/tests/test_image.py
+++ b/tests/test_image.py
@@ -1098,14 +1098,16 @@ def _test_Image_save(imgtype):
             # Load the image back in
             img2 = fslimage.Image(img.dataSource)
 
-            assert img.saveState
-            assert img.dataSource == expDataSource
+            assert img2.saveState
+            assert img2.dataSource == expDataSource
 
-            if imgtype > 0:
-                assert np.all(np.isclose(img.voxToWorldMat, xform))
+            for i in (img, img2):
+                if imgtype > 0:
+                    assert np.all(np.isclose(i.voxToWorldMat, xform))
 
-            for (x, y, z), v in zip(rvoxs, rvals):
-                assert np.isclose(img[x, y, z], v)
+                for (x, y, z), v in zip(rvoxs, rvals):
+                    assert np.isclose(i[x, y, z], v)
+            img  = None
             img2 = None
 
 
-- 
GitLab