Skip to content

Commit f2fb28d

Browse files
committed
Tidy
1 parent 061a8be commit f2fb28d

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

cylc/flow/task_outputs.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -419,14 +419,10 @@ def get_completed_outputs(self) -> Dict[str, str]:
419419
Replace message with "forced" if the output was forced.
420420
421421
"""
422-
def _get_msg(message):
423-
if message in self._forced:
424-
return FORCED_COMPLETION_MSG
425-
else:
426-
return message
427-
428422
return {
429-
self._message_to_trigger[message]: _get_msg(message)
423+
self._message_to_trigger[message]: (
424+
FORCED_COMPLETION_MSG if message in self._forced else message
425+
)
430426
for message, is_completed in self._completed.items()
431427
if is_completed
432428
}

tests/integration/test_dbstatecheck.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,15 @@
2020
from asyncio import sleep
2121
import pytest
2222
from textwrap import dedent
23-
from typing import TYPE_CHECKING
2423

25-
from cylc.flow.dbstatecheck import CylcWorkflowDBChecker as Checker
26-
27-
28-
if TYPE_CHECKING:
29-
from cylc.flow.dbstatecheck import CylcWorkflowDBChecker
24+
from cylc.flow.dbstatecheck import CylcWorkflowDBChecker
25+
from cylc.flow.scheduler import Scheduler
3026

3127

3228
@pytest.fixture(scope='module')
3329
async def checker(
3430
mod_flow, mod_scheduler, mod_run, mod_complete
35-
) -> 'CylcWorkflowDBChecker':
31+
):
3632
"""Make a real world database.
3733
3834
We could just write the database manually but this is a better
@@ -53,17 +49,16 @@ async def checker(
5349
'output': {'outputs': {'trigger': 'message'}}
5450
}
5551
})
56-
schd = mod_scheduler(wid, paused_start=False)
52+
schd: Scheduler = mod_scheduler(wid, paused_start=False)
5753
async with mod_run(schd):
5854
await mod_complete(schd)
5955
schd.pool.force_trigger_tasks(['1000/good'], [2])
6056
# Allow a cycle of the main loop to pass so that flow 2 can be
6157
# added to db
6258
await sleep(1)
63-
yield Checker(
64-
'somestring', 'utterbunkum',
65-
schd.workflow_db_mgr.pub_path
66-
)
59+
yield CylcWorkflowDBChecker(
60+
'somestring', 'utterbunkum', schd.workflow_db_mgr.pub_path
61+
)
6762

6863

6964
def test_basic(checker):

0 commit comments

Comments
 (0)