Skip to content

Commit a170644

Browse files
committed
Added import and reduced resources used
1 parent 29bcd80 commit a170644

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

nipype/interfaces/tests/test_runtime_profiler.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def setUp(self):
7171
a unittest.TestCase-inherited class
7272
'''
7373

74-
self.num_gb = 2
74+
self.num_gb = 1
7575
self.num_procs = 2
7676

7777
# Test node
@@ -95,6 +95,7 @@ def _run_workflow(self):
9595
# Import packages
9696
import logging
9797
import os
98+
import shutil
9899
import tempfile
99100

100101
import nipype.pipeline.engine as pe
@@ -152,8 +153,7 @@ def _run_workflow(self):
152153
# Test resources were used as expected
153154
def test_wf_logfile(self):
154155
'''
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
157157
'''
158158

159159
# Import packages
@@ -171,12 +171,15 @@ def test_wf_logfile(self):
171171
runtime_gb = float(node_stats['runtime_memory'])
172172
runtime_procs = int(node_stats['runtime_threads'])
173173

174-
# Assert runtime stats are what was input
174+
# Error message formatting
175175
mem_err = 'Input memory: %.5f is not within %d places of runtime '\
176176
'memory: %.5f' % (self.num_gb, places, runtime_gb)
177-
self.assertAlmostEqual(self.num_gb, runtime_gb, places=places, msg=mem_err)
178177
procs_err = 'Input procs: %d is not equal to runtime procs: %d' \
179178
% (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)
180183
self.assertEqual(self.num_procs, runtime_procs, msg=procs_err)
181184

182185

0 commit comments

Comments
 (0)