Commit 5d842760 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

TEST: mockFSLDIR helper function clobbers fsldevdir

parent 3c7bff49
......@@ -36,7 +36,8 @@ logging.getLogger().setLevel(logging.WARNING)
@contextlib.contextmanager
def mockFSLDIR():
oldval = fslplatform.fsldir
oldfsldir = fslplatform.fsldir
oldfsldevdir = fslplatform.fsldevdir
try:
with tempdir() as td:
......@@ -44,13 +45,15 @@ def mockFSLDIR():
bindir = op.join(fsldir, 'bin')
os.makedirs(bindir)
fslplatform.fsldir = fsldir
fslplatform.fsldevdir = None
path = op.pathsep.join((bindir, os.environ['PATH']))
with mock.patch.dict(os.environ, {'PATH': path}):
yield fsldir
finally:
fslplatform.fsldir = oldval
fslplatform.fsldir = oldfsldir
fslplatform.fsldevdir = oldfsldevdir
def touch(fname):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment