Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fslpy
Commits
5d842760
Commit
5d842760
authored
6 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
TEST: mockFSLDIR helper function clobbers fsldevdir
parent
3c7bff49
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/__init__.py
+5
-2
5 additions, 2 deletions
tests/__init__.py
with
5 additions
and
2 deletions
tests/__init__.py
+
5
−
2
View file @
5d842760
...
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment