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
ba7ac161
Unverified
Commit
ba7ac161
authored
1 year ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
Remove duplicate test_func_to_cmd test
This test is already defined in test_run.py
parent
444d4cfe
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
fsl/tests/test_fslsub.py
+1
-42
1 addition, 42 deletions
fsl/tests/test_fslsub.py
with
1 addition
and
42 deletions
fsl/tests/test_fslsub.py
+
1
−
42
View file @
ba7ac161
...
@@ -239,45 +239,4 @@ def test_info():
...
@@ -239,45 +239,4 @@ def test_info():
assert
res2
[
'
1
'
]
is
None
assert
res2
[
'
1
'
]
is
None
with
pytest
.
raises
(
ValueError
):
with
pytest
.
raises
(
ValueError
):
fslsub
.
_parse_qstat
(
valid_job_ids
[
0
],
example_qstat_reply
)
fslsub
.
_parse_qstat
(
valid_job_ids
[
0
],
example_qstat_reply
)
\ No newline at end of file
def
_good_func
():
print
(
'
hello
'
)
def
_bad_func
():
1
/
0
def
test_func_to_cmd
():
cwd
=
os
.
getcwd
()
with
tempdir
():
for
tmp_dir
in
(
None
,
'
.
'
):
for
clean
in
(
'
never
'
,
'
on_success
'
,
'
always
'
):
for
verbose
in
(
False
,
True
):
cmd
=
fslsub
.
func_to_cmd
(
_good_func
,
clean
=
clean
,
tmp_dir
=
tmp_dir
,
verbose
=
verbose
)
fn
=
cmd
.
split
()[
-
1
]
assert
op
.
exists
(
fn
)
stdout
,
stderr
,
exitcode
=
run
.
run
(
cmd
,
exitcode
=
True
,
stdout
=
True
,
stderr
=
True
,
env
=
{
"
PYTHONPATH
"
:
cwd
})
assert
exitcode
==
0
if
clean
==
'
never
'
:
assert
op
.
exists
(
fn
),
"
Successful job got removed, even though this was not requested
"
else
:
assert
not
op
.
exists
(
fn
),
f
"
Successful job did not get removed after run for clean =
{
clean
}
"
if
verbose
:
assert
stdout
.
strip
()
==
f
'
running
"
{
fn
}
"
\n
hello
'
else
:
assert
stdout
.
strip
()
==
'
hello
'
cmd
=
fslsub
.
func_to_cmd
(
_bad_func
,
clean
=
clean
,
tmp_dir
=
tmp_dir
)
fn
=
cmd
.
split
()[
-
1
]
assert
op
.
exists
(
fn
)
stdout
,
stderr
,
exitcode
=
run
.
run
(
cmd
,
exitcode
=
True
,
stdout
=
True
,
stderr
=
True
,
env
=
{
'
PYTHONPATH
'
:
cwd
})
assert
exitcode
!=
0
if
clean
==
'
always
'
:
assert
not
op
.
exists
(
fn
),
"
Failing job should always be removed if requested
"
else
:
assert
op
.
exists
(
fn
),
f
"
Failing job got removed even with clean =
{
clean
}
"
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