From 9855cd38b1a52b2fa8c2dc87cc12535e21ae711c Mon Sep 17 00:00:00 2001 From: Tim Pillinger <26465611+wxtim@users.noreply.github.com> Date: Fri, 15 Nov 2024 09:15:30 +0000 Subject: [PATCH] Response to review Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com> --- .../run_modes/test_mode_overrides.py | 1 - tests/integration/test_config.py | 4 ++- tests/integration/test_task_pool.py | 3 --- tests/unit/run_modes/test__init__.py | 25 +++++++++++++++++++ 4 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 tests/unit/run_modes/test__init__.py diff --git a/tests/integration/run_modes/test_mode_overrides.py b/tests/integration/run_modes/test_mode_overrides.py index c28a2ff050..9b67f58e61 100644 --- a/tests/integration/run_modes/test_mode_overrides.py +++ b/tests/integration/run_modes/test_mode_overrides.py @@ -52,7 +52,6 @@ async def test_run_mode_override_from_config( }, }, 'runtime': { - 'root': {'simulation': {'default run length': 'PT0S'}}, 'live': {'run mode': 'live'}, 'skip': {'run mode': 'skip'}, } diff --git a/tests/integration/test_config.py b/tests/integration/test_config.py index 4a1a2dc11c..e0c4f5b2ca 100644 --- a/tests/integration/test_config.py +++ b/tests/integration/test_config.py @@ -627,7 +627,9 @@ def test_skip_forbidden_as_output(flow, validate): 'scheduling': {'graph': {'R1': 'task'}}, 'runtime': {'task': {'outputs': {'skip': 'message for skip'}}} }) - with pytest.raises(WorkflowConfigError, match='message for skip'): + with pytest.raises( + WorkflowConfigError, match='Invalid task output .* cannot be: `skip`' + ): validate(wid) diff --git a/tests/integration/test_task_pool.py b/tests/integration/test_task_pool.py index 483b67cad2..1a15ba61f0 100644 --- a/tests/integration/test_task_pool.py +++ b/tests/integration/test_task_pool.py @@ -1591,9 +1591,6 @@ async def test_set_outputs_from_skip_settings( """ id_ = flow( { - 'scheduler': { - 'allow implicit tasks': 'True', - }, 'scheduling': { 'cycling mode': 'integer', 'initial cycle point': 1, diff --git a/tests/unit/run_modes/test__init__.py b/tests/unit/run_modes/test__init__.py new file mode 100644 index 0000000000..2a88d5030d --- /dev/null +++ b/tests/unit/run_modes/test__init__.py @@ -0,0 +1,25 @@ +# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE. +# Copyright (C) NIWA & British Crown (Met Office) & Contributors. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +"""Tests for utilities supporting run modes. +""" + +from cylc.flow.run_modes import RunMode + + +def test_run_mode_desc(): + """All run mode labels have descriptions.""" + for mode in RunMode: + assert mode.describe()