Skip to content
Snippets Groups Projects
Commit 356e71a6 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Merge branch '51-execute-only-command-line-option-does-not-work' into 'master'

Resolve "--execute-only command line option does not work"

Closes #51

This was just a small issue, which I have solved. I also added a new test case for the `--execute-only` command line option.

See merge request !51
parents 130abfee eb83312c
No related branches found
No related tags found
1 merge request!51Resolve "--execute-only command line option does not work"
Pipeline #
...@@ -253,6 +253,33 @@ def test_verify_missing(): ...@@ -253,6 +253,33 @@ def test_verify_missing():
shutil.rmtree(test_dir) shutil.rmtree(test_dir)
def test_verify_execute_only():
test_dir = tempfile.mkdtemp(prefix='bobtest_')
# define dummy parameters
parameters = [
'-d', 'dummy',
'-p', 'dummy',
'-e', 'dummy',
'-a', 'dummy',
'--zt-norm',
'--allow-missing-files',
'-vs', 'test_missing',
'--temp-directory', test_dir,
'--result-directory', test_dir,
'--preferred-package', 'bob.bio.base',
'--imports', 'bob.bio.base.test.dummy',
'--execute-only', 'preprocessing', 'score-computation',
'--dry-run'
]
try:
from bob.bio.base.script.verify import main
main(parameters)
finally:
if os.path.exists(test_dir):
shutil.rmtree(test_dir)
def test_internal_raises(): def test_internal_raises():
test_dir = tempfile.mkdtemp(prefix='bobtest_') test_dir = tempfile.mkdtemp(prefix='bobtest_')
# define dummy parameters # define dummy parameters
......
...@@ -271,7 +271,7 @@ def initialize(parsers, command_line_parameters = None, skips = []): ...@@ -271,7 +271,7 @@ def initialize(parsers, command_line_parameters = None, skips = []):
if skips is not None and args.execute_only is not None: if skips is not None and args.execute_only is not None:
for skip in skips: for skip in skips:
if skip not in args.execute_only: if skip not in args.execute_only:
setattr("args", "skip_%s" % skip.replace("-", "_"), True) setattr(args, "skip_%s" % skip.replace("-", "_"), True)
if args.parallel is not None: if args.parallel is not None:
args.grid = bob.bio.base.grid.Grid("local", number_of_parallel_processes = args.parallel) args.grid = bob.bio.base.grid.Grid("local", number_of_parallel_processes = args.parallel)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment