Repository: nipy/nipype

Issue:
pytest generates deprecation warning for `message` parameter
### Summary

pytest has deprecated `message` parameter for checking exceptions. this bloats the testing output for pytest.

### Actual behavior
```
/src/nipype/nipype/algorithms/tests/test_CompCor.py:148

  /src/nipype/nipype/algorithms/tests/test_CompCor.py:148: PytestDeprecationWarning: The 'message' parameter is deprecated.

  (did you mean to use `match='some regex'` to check the exception message?)

  Please comment on https://github.com/pytest-dev/pytest/issues/3974 if you have concerns about removal of this parameter.

    with pytest.raises(ValueError, message='more than one mask file'):
```

### Expected behavior
no warnings from pytest

### How to replicate the behavior
current travis tests

### Platform details:

travis testing



Discussion:

Resolving patch:
diff --git a/nipype/interfaces/dipy/tracks.py b/nipype/interfaces/dipy/tracks.py
--- a/nipype/interfaces/dipy/tracks.py
+++ b/nipype/interfaces/dipy/tracks.py
@@ -20,13 +20,16 @@
 if HAVE_DIPY and LooseVersion(dipy_version()) >= LooseVersion('0.15'):
 
     from dipy.workflows.segment import RecoBundlesFlow, LabelsBundlesFlow
-    from dipy.workflows.tracking import DetTrackPAMFlow
+    try:
+        from dipy.workflows.tracking import LocalFiberTrackingPAMFlow as DetTrackFlow
+    except ImportError:  # different name in 0.15
+        from dipy.workflows.tracking import DetTrackPAMFlow as DetTrackFlow
 
     RecoBundles = dipy_to_nipype_interface("RecoBundles", RecoBundlesFlow)
     LabelsBundles = dipy_to_nipype_interface("LabelsBundles",
                                              LabelsBundlesFlow)
     DeterministicTracking = dipy_to_nipype_interface("DeterministicTracking",
-                                                     DetTrackPAMFlow)
+                                                     DetTrackFlow)
 
 else:
     IFLOGGER.info("We advise you to upgrade DIPY version. This upgrade will"


Test patch:
diff --git a/nipype/algorithms/tests/test_CompCor.py b/nipype/algorithms/tests/test_CompCor.py
--- a/nipype/algorithms/tests/test_CompCor.py
+++ b/nipype/algorithms/tests/test_CompCor.py
@@ -108,15 +108,15 @@ def test_compcor_bad_input_shapes(self):
             data_file = utils.save_toy_nii(np.zeros(data_shape), 'temp.nii')
             interface = CompCor(
                 realigned_file=data_file, mask_files=self.mask_files[0])
-            with pytest.raises(ValueError, message="Dimension mismatch"):
-                interface.run()
+            with pytest.raises(ValueError):
+                interface.run()  # Dimension mismatch
 
     def test_tcompcor_bad_input_dim(self):
         bad_dims = (2, 2, 2)
         data_file = utils.save_toy_nii(np.zeros(bad_dims), 'temp.nii')
         interface = TCompCor(realigned_file=data_file)
-        with pytest.raises(ValueError, message='Not a 4D file'):
-            interface.run()
+        with pytest.raises(ValueError):
+            interface.run()  # Not a 4D file
 
     def test_tcompcor_merge_intersect_masks(self):
         for method in ['union', 'intersect']:
@@ -145,8 +145,8 @@ def test_tcompcor_index_mask(self):
     def test_tcompcor_multi_mask_no_index(self):
         interface = TCompCor(
             realigned_file=self.realigned_file, mask_files=self.mask_files)
-        with pytest.raises(ValueError, message='more than one mask file'):
-            interface.run()
+        with pytest.raises(ValueError):
+            interface.run()  # more than one mask file
 
     def run_cc(self,
                ccinterface,
diff --git a/nipype/testing/__init__.py b/nipype/testing/__init__.py
--- a/nipype/testing/__init__.py
+++ b/nipype/testing/__init__.py
@@ -16,10 +16,10 @@
 template = funcfile
 transfm = funcfile
 
-from . import decorators as dec
+from . import decorators
 from .utils import package_check, TempFATFS
 
-skipif = dec.skipif
+skipif = decorators.dec.skipif
 
 
 def example_data(infile='functional.nii'):
diff --git a/nipype/testing/decorators.py b/nipype/testing/decorators.py
--- a/nipype/testing/decorators.py
+++ b/nipype/testing/decorators.py
@@ -4,8 +4,7 @@
 """
 Extend numpy's decorators to use nipype's gui and data labels.
 """
-
-from numpy.testing.decorators import knownfailureif, skipif
+from numpy.testing import dec
 
 from nibabel.data import DataError
 
@@ -81,19 +80,19 @@ def needs_review(msg):
     """
 
     def skip_func(func):
-        return skipif(True, msg)(func)
+        return dec.skipif(True, msg)(func)
 
     return skip_func
 
 
 # Easier version of the numpy knownfailure
 def knownfailure(f):
-    return knownfailureif(True)(f)
+    return dec.knownfailureif(True)(f)
 
 
 def if_datasource(ds, msg):
     try:
         ds.get_filename()
     except DataError:
-        return skipif(True, msg)
+        return dec.skipif(True, msg)
     return lambda f: f