From df4ca6f02b2acbf920c534134b28258418bfec63 Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Fri, 12 Oct 2018 19:11:12 +0100
Subject: [PATCH] TEST: Suppressing more warnings. Image(indexed) parameter is
 deprecated. More work to do here

---
 tests/test_atlases.py       |  6 +++---
 tests/test_atlases_query.py |  3 +--
 tests/test_atlasq_ohi.py    |  1 -
 tests/test_atlasq_query.py  |  1 -
 tests/test_vest.py          | 10 +++++++---
 5 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/tests/test_atlases.py b/tests/test_atlases.py
index 9853c5a73..80be87c74 100644
--- a/tests/test_atlases.py
+++ b/tests/test_atlases.py
@@ -225,7 +225,7 @@ def test_load_atlas():
     reg.rescanAtlases()
 
     probatlas    = reg.loadAtlas('harvardoxford-cortical',
-                                 indexed=True, calcRange=False, loadData=False)
+                                 calcRange=False, loadData=False)
     probsumatlas = reg.loadAtlas('harvardoxford-cortical', loadSummary=True)
     lblatlas     = reg.loadAtlas('talairach')
 
@@ -240,7 +240,7 @@ def test_find():
     reg.rescanAtlases()
 
     probatlas    = reg.loadAtlas('harvardoxford-cortical',
-                                 indexed=True, calcRange=False, loadData=False)
+                                 calcRange=False, loadData=False)
     probsumatlas = reg.loadAtlas('harvardoxford-cortical', loadSummary=True)
     lblatlas     = reg.loadAtlas('talairach')
 
@@ -273,7 +273,7 @@ def test_prepareMask():
     reg.rescanAtlases()
 
     probatlas    = reg.loadAtlas('harvardoxford-cortical',
-                                 indexed=True, loadData=False, calcRange=False)
+                                 loadData=False, calcRange=False)
     probsumatlas = reg.loadAtlas('harvardoxford-cortical', loadSummary=True)
     lblatlas     = reg.loadAtlas('talairach')
 
diff --git a/tests/test_atlases_query.py b/tests/test_atlases_query.py
index 29676a09b..f90c8d406 100644
--- a/tests/test_atlases_query.py
+++ b/tests/test_atlases_query.py
@@ -45,8 +45,7 @@ def _get_atlas(atlasID, res, summary=False):
             kwargs = {}
         else:
             kwargs = {'loadData'  : False,
-                      'calcRange' : False,
-                      'indexed'   : True}
+                      'calcRange' : False}
 
         atlas = fslatlases.loadAtlas(atlasID,
                                      loadSummary=summary,
diff --git a/tests/test_atlasq_ohi.py b/tests/test_atlasq_ohi.py
index 36279ce69..2c0e4e7aa 100644
--- a/tests/test_atlasq_ohi.py
+++ b/tests/test_atlasq_ohi.py
@@ -98,7 +98,6 @@ def test_coords(seed):
         atlas = fslatlases.loadAtlas(
             ad.atlasID,
             resolution=2,
-            indexed=True,
             calcRange=False,
             loadData=False)
 
diff --git a/tests/test_atlasq_query.py b/tests/test_atlasq_query.py
index 85fe4ca48..987cd0114 100644
--- a/tests/test_atlasq_query.py
+++ b/tests/test_atlasq_query.py
@@ -442,7 +442,6 @@ def test_bad_mask(seed):
             atlas  = fslatlases.loadAtlas(
                 atlasID,
                 loadSummary=use_label,
-                indexed=True,
                 loadData=False,
                 calcRange=False)
             ashape = list(atlas.shape[:3])
diff --git a/tests/test_vest.py b/tests/test_vest.py
index 84638a3ce..df74b5b8c 100644
--- a/tests/test_vest.py
+++ b/tests/test_vest.py
@@ -9,6 +9,7 @@
 import os.path as op
 import            shutil
 import            tempfile
+import            warnings
 
 import numpy   as np
 import            pytest
@@ -166,9 +167,12 @@ def test_loadVestLutFile():
         for i in range(4):
             f       = testfiles[i]
             d       = testdata[ i]
-            dnorm   = (d - d.min()) / (d.max() - d.min())
-            lutnorm = vest.loadVestLutFile(f)
-            lut     = vest.loadVestLutFile(f, normalise=False)
+
+            with warnings.catch_warnings():
+                warnings.simplefilter('ignore')
+                dnorm   = (d - d.min()) / (d.max() - d.min())
+                lutnorm = vest.loadVestLutFile(f)
+                lut     = vest.loadVestLutFile(f, normalise=False)
 
             assert lut.shape     == d.shape
             assert lutnorm.shape == dnorm.shape
-- 
GitLab