Skip to content

Commit fe60dfc

Browse files
committed
removed references to nose and fixed exception discrepancy between Py2 and Py3
1 parent 4d67bc3 commit fe60dfc

File tree

6 files changed

+9
-36
lines changed

6 files changed

+9
-36
lines changed

nipype/pipeline/engine/nodes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,10 @@ def _node_runner(self, nodes, updatehash=False):
11291129
try:
11301130
node.run(updatehash=updatehash)
11311131
except Exception as e:
1132-
err = str(e)
1132+
if sys.version < 3:
1133+
err = e
1134+
else:
1135+
err = str(e)
11331136
if str2bool(self.config['execution']['stop_on_first_crash']):
11341137
raise
11351138
finally:
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
# -*- coding: utf-8 -*-
22
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
33
# vi: set ft=python sts=4 ts=4 sw=4 et:
4-
5-
from nipype.testing import skip_if_no_package
6-
skip_if_no_package('networkx', '1.0')

nipype/pipeline/engine/tests/test_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ def myfunction(string):
384384

385385
def test_mapnode_crash3(tmpdir):
386386
"""Test mapnode crash when mapnode is embedded in a workflow"""
387+
387388
def myfunction(string):
388389
return string + 'meh'
389390
node = pe.MapNode(niu.Function(input_names=['WRONG'],
@@ -393,7 +394,8 @@ def myfunction(string):
393394
name='myfunc')
394395

395396
node.inputs.WRONG = ['string' + str(i) for i in range(3)]
396-
wf = pe.Workflow('test_mapnode_crash')
397+
wf = pe.Workflow('testmapnodecrash')
398+
wf.config['crashdump_dir'] = str(tmpdir)
397399
wf.add_nodes([node])
398400
wf.base_dir = str(tmpdir)
399401

nipype/testing/README

Lines changed: 0 additions & 6 deletions
This file was deleted.

nipype/testing/__init__.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,7 @@
22
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
33
# vi: set ft=python sts=4 ts=4 sw=4 et:
44
"""The testing directory contains a small set of imaging files to be
5-
used for doctests only. More thorough tests and example data will be
6-
stored in a nipy data packages that you can download separately.
7-
8-
.. note:
9-
10-
We use the ``nose`` testing framework for tests.
11-
12-
Nose is a dependency for the tests, but should not be a dependency
13-
for running the algorithms in the NIPY library. This file should
14-
import without nose being present on the python path.
15-
5+
used for doctests only.
166
"""
177

188
import os
@@ -28,7 +18,7 @@
2818

2919

3020
from . import decorators as dec
31-
from .utils import skip_if_no_package, package_check, TempFATFS
21+
from .utils import package_check, TempFATFS
3222

3323
skipif = dec.skipif
3424

nipype/testing/utils.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import subprocess
1414
from subprocess import CalledProcessError
1515
from tempfile import mkdtemp
16-
from nose import SkipTest
1716
from future.utils import raise_from
1817
from ..utils.misc import package_check
1918

@@ -22,18 +21,6 @@
2221
import numpy as np
2322
import nibabel as nb
2423

25-
def skip_if_no_package(*args, **kwargs):
26-
"""Raise SkipTest if package_check fails
27-
28-
Parameters
29-
----------
30-
*args Positional parameters passed to `package_check`
31-
*kwargs Keyword parameters passed to `package_check`
32-
"""
33-
package_check(exc_failed_import=SkipTest,
34-
exc_failed_check=SkipTest,
35-
*args, **kwargs)
36-
3724

3825
class TempFATFS(object):
3926
def __init__(self, size_in_mbytes=8, delay=0.5):

0 commit comments

Comments
 (0)