diff --git a/cylc/flow/task_outputs.py b/cylc/flow/task_outputs.py index 39da3750b59..40b9d991b30 100644 --- a/cylc/flow/task_outputs.py +++ b/cylc/flow/task_outputs.py @@ -419,14 +419,10 @@ def get_completed_outputs(self) -> Dict[str, str]: Replace message with "forced" if the output was forced. """ - def _get_msg(message): - if message in self._forced: - return FORCED_COMPLETION_MSG - else: - return message - return { - self._message_to_trigger[message]: _get_msg(message) + self._message_to_trigger[message]: ( + FORCED_COMPLETION_MSG if message in self._forced else message + ) for message, is_completed in self._completed.items() if is_completed } diff --git a/tests/integration/test_dbstatecheck.py b/tests/integration/test_dbstatecheck.py index a6da4348ffb..33db2ec4c2a 100644 --- a/tests/integration/test_dbstatecheck.py +++ b/tests/integration/test_dbstatecheck.py @@ -20,19 +20,15 @@ from asyncio import sleep import pytest from textwrap import dedent -from typing import TYPE_CHECKING -from cylc.flow.dbstatecheck import CylcWorkflowDBChecker as Checker - - -if TYPE_CHECKING: - from cylc.flow.dbstatecheck import CylcWorkflowDBChecker +from cylc.flow.dbstatecheck import CylcWorkflowDBChecker +from cylc.flow.scheduler import Scheduler @pytest.fixture(scope='module') async def checker( mod_flow, mod_scheduler, mod_run, mod_complete -) -> 'CylcWorkflowDBChecker': +): """Make a real world database. We could just write the database manually but this is a better @@ -53,17 +49,16 @@ async def checker( 'output': {'outputs': {'trigger': 'message'}} } }) - schd = mod_scheduler(wid, paused_start=False) + schd: Scheduler = mod_scheduler(wid, paused_start=False) async with mod_run(schd): await mod_complete(schd) schd.pool.force_trigger_tasks(['1000/good'], [2]) # Allow a cycle of the main loop to pass so that flow 2 can be # added to db await sleep(1) - yield Checker( - 'somestring', 'utterbunkum', - schd.workflow_db_mgr.pub_path - ) + yield CylcWorkflowDBChecker( + 'somestring', 'utterbunkum', schd.workflow_db_mgr.pub_path + ) def test_basic(checker):