diff --git a/tests/conftest.py b/tests/conftest.py index 9a6464f4..631c93b2 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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, @@ -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() @@ -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() @@ -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()