Skip to content

Commit cbe93e7

Browse files
committed
checking if a proper custom exception is raised in test_node_hash
1 parent 66246e1 commit cbe93e7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

nipype/pipeline/engine/tests/test_engine.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,11 +512,16 @@ def func2(a):
512512
# create dummy distributed plugin class
513513
from nipype.pipeline.plugins.base import DistributedPluginBase
514514

515+
# create a custom exception
516+
class EngineTestException(Exception):
517+
pass
518+
515519
class RaiseError(DistributedPluginBase):
516520
def _submit_job(self, node, updatehash=False):
517-
raise Exception('Submit called')
521+
raise EngineTestException('Submit called')
518522

519-
with pytest.raises(Exception) as excinfo:
523+
# check if a proper exception is raised
524+
with pytest.raises(EngineTestException) as excinfo:
520525
w1.run(plugin=RaiseError())
521526
assert 'Submit called' == str(excinfo.value)
522527

0 commit comments

Comments
 (0)