@@ -71,7 +71,7 @@ def setUp(self):
71
71
a unittest.TestCase-inherited class
72
72
'''
73
73
74
- self .num_gb = 2
74
+ self .num_gb = 1
75
75
self .num_procs = 2
76
76
77
77
# Test node
@@ -95,6 +95,7 @@ def _run_workflow(self):
95
95
# Import packages
96
96
import logging
97
97
import os
98
+ import shutil
98
99
import tempfile
99
100
100
101
import nipype .pipeline .engine as pe
@@ -152,8 +153,7 @@ def _run_workflow(self):
152
153
# Test resources were used as expected
153
154
def test_wf_logfile (self ):
154
155
'''
155
- Test to see that the input resources to consume match what was
156
- recorded during runtime
156
+ Test runtime profiler correctly records workflow RAM/CPUs consumption
157
157
'''
158
158
159
159
# Import packages
@@ -171,12 +171,15 @@ def test_wf_logfile(self):
171
171
runtime_gb = float (node_stats ['runtime_memory' ])
172
172
runtime_procs = int (node_stats ['runtime_threads' ])
173
173
174
- # Assert runtime stats are what was input
174
+ # Error message formatting
175
175
mem_err = 'Input memory: %.5f is not within %d places of runtime ' \
176
176
'memory: %.5f' % (self .num_gb , places , runtime_gb )
177
- self .assertAlmostEqual (self .num_gb , runtime_gb , places = places , msg = mem_err )
178
177
procs_err = 'Input procs: %d is not equal to runtime procs: %d' \
179
178
% (self .num_procs , runtime_procs )
179
+
180
+ # Assert runtime stats are what was input
181
+ self .assertAlmostEqual (self .num_gb , runtime_gb , places = places ,
182
+ msg = mem_err )
180
183
self .assertEqual (self .num_procs , runtime_procs , msg = procs_err )
181
184
182
185
0 commit comments