Skip to content

Commit

Permalink
Tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
MetRonnie committed Jun 17, 2024
1 parent 061a8be commit f2fb28d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
10 changes: 3 additions & 7 deletions cylc/flow/task_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
19 changes: 7 additions & 12 deletions tests/integration/test_dbstatecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down

0 comments on commit f2fb28d

Please sign in to comment.