Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import Cylc option parser Options object to set up options #232

Merged
merged 4 commits into from
Jun 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 4 additions & 25 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from types import SimpleNamespace

from cylc.flow import __version__ as CYLC_VERSION
from cylc.flow.option_parsers import Options

from cylc.flow.scripts.validate import (
_main as cylc_validate,
Expand Down Expand Up @@ -100,13 +101,7 @@ def _cylc_validate_cli(capsys, caplog):
"""Access the validate CLI"""
def _inner(srcpath, args=None):
parser = validate_gop()
options = parser.get_default_values()
options.__dict__.update({
'templatevars': [], 'templatevars_file': []
})

if args is not None:
options.__dict__.update(args)
options = Options(parser, args)()

output = SimpleNamespace()

Expand Down Expand Up @@ -134,15 +129,7 @@ def _inner(srcpath, args=None):
srcpath:
args: Dictionary of arguments.
"""
parser = install_gop()
options = parser.get_default_values()
options.__dict__.update({
'profile_mode': None, 'templatevars': [], 'templatevars_file': [],
'output': None
})

if args is not None:
options.__dict__.update(args)
options = Options(install_gop(), args)()

output = SimpleNamespace()

Expand All @@ -168,15 +155,7 @@ def _inner(workflow_id, opts=None):
srcpath:
args: Dictionary of arguments.
"""
parser = reinstall_gop()
options = parser.get_default_values()
options.__dict__.update({
'profile_mode': None, 'templatevars': [], 'templatevars_file': [],
'output': None
})

if opts is not None:
options.__dict__.update(opts)
options = Options(reinstall_gop(), opts)()

output = SimpleNamespace()

Expand Down