Skip to content

Commit 5f8e109

Browse files
author
Shoshana Berleant
committed
patch to work around #1517
1 parent 14e494a commit 5f8e109

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

nipype/pipeline/plugins/tests/test_base.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,22 @@ def test_scipy_sparse():
2020

2121
def test_report_crash():
2222
with mock.patch('pickle.dump', mock.MagicMock()) as mock_pickle_dump:
23-
mock_pickle_dump.return_value = True
24-
mock_node = mock.MagicMock(name='mock_node')
25-
mock_node._id = 'an_id'
26-
mock_node.config = {
27-
'execution' : {
28-
'crashdump_dir' : '.'
23+
with mock.patch('nipype.pipeline.plugins.base.format_exception', mock.MagicMock()): # see iss 1517
24+
mock_pickle_dump.return_value = True
25+
mock_node = mock.MagicMock(name='mock_node')
26+
mock_node._id = 'an_id'
27+
mock_node.config = {
28+
'execution' : {
29+
'crashdump_dir' : '.'
30+
}
2931
}
30-
}
3132

32-
actual_crashfile = pb.report_crash(mock_node)
33+
actual_crashfile = pb.report_crash(mock_node)
3334

34-
expected_crashfile = re.compile('.*/crash-.*-an_id-[0-9a-f\-]*.pklz')
35+
expected_crashfile = re.compile('.*/crash-.*-an_id-[0-9a-f\-]*.pklz')
3536

36-
yield assert_regexp_matches, actual_crashfile, expected_crashfile
37-
yield assert_true, mock_pickle_dump.call_count == 1
37+
yield assert_regexp_matches, actual_crashfile, expected_crashfile
38+
yield assert_true, mock_pickle_dump.call_count == 1
3839

3940
'''
4041
Can use the following code to test that a mapnode crash continues successfully

0 commit comments

Comments
 (0)