diff --git a/cylc/flow/scheduler.py b/cylc/flow/scheduler.py index 8ba5f48289..9bff4542ad 100644 --- a/cylc/flow/scheduler.py +++ b/cylc/flow/scheduler.py @@ -433,7 +433,7 @@ async def configure(self, params): if run_mode != og_run_mode: raise InputError( "This workflow was originally run in " - f"{run_mode.value} mode:" + f"{og_run_mode.value} mode:" f" Will not restart in {run_mode.value} mode." ) diff --git a/tests/integration/test_mode_on_restart.py b/tests/integration/test_mode_on_restart.py index 8062893391..0eadf4b4a9 100644 --- a/tests/integration/test_mode_on_restart.py +++ b/tests/integration/test_mode_on_restart.py @@ -20,6 +20,7 @@ from cylc.flow.exceptions import InputError from cylc.flow.scheduler import Scheduler +from cylc.flow.run_modes import RunMode MODES = [('live'), ('simulation'), ('dummy')] @@ -42,7 +43,7 @@ async def test_restart_mode( async with start(schd): if not mode_before: mode_before = 'live' - assert schd.get_run_mode() == mode_before + assert schd.get_run_mode().value == mode_before schd = scheduler(id_, run_mode=mode_after) @@ -52,7 +53,7 @@ async def test_restart_mode( ): # Restarting in the same mode is fine. async with run(schd): - assert schd.get_run_mode() == mode_before + assert schd.get_run_mode().value == mode_before else: # Restarting in a new mode is not: errormsg = f'^This.*{mode_before} mode: Will.*{mode_after} mode.$'