Skip to content

Commit f125c0f

Browse files
committed
Response to review
1 parent 08f2836 commit f125c0f

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

cylc/flow/config.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2270,7 +2270,7 @@ def load_graph(self):
22702270

22712271
# Checking for undefined outputs for terminal tasks. Tasks with
22722272
# dependencies are checked in generate_triggers:
2273-
self.check_outputs(parser.terminals)
2273+
self.check_terminal_outputs(parser.terminals)
22742274

22752275
self.set_required_outputs(task_output_opt)
22762276

@@ -2284,12 +2284,16 @@ def load_graph(self):
22842284
for tdef in self.taskdefs.values():
22852285
tdef.tweak_outputs()
22862286

2287-
def check_outputs(self, terminals: Iterable[str]) -> None:
2287+
def check_terminal_outputs(self, terminals: Iterable[str]) -> None:
22882288
"""Check that task outputs have been registered with tasks.
22892289
2290+
2291+
Where a "terminal output" is an output for a task at the end of a
2292+
graph string, such as "end" in `start => middle => end`.
2293+
22902294
Raises: WorkflowConfigError if a custom output is not defined.
22912295
"""
2292-
# TODO (On drop 3.7): Can be simplified with walrus :=
2296+
# BACK COMPAT: (On drop 3.7): Can be simplified with walrus :=
22932297
# if (b := a[1].strip("?")) not in TASK_QUALIFIERS
22942298
terminal_outputs = [
22952299
(a[0].strip("!"), a[1].strip("?"))

cylc/flow/task_outputs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ def color_wrap(string, is_complete):
601601
@staticmethod
602602
def is_valid_std_name(name: str) -> bool:
603603
"""Check name is a valid standard output name."""
604-
return name in TASK_OUTPUTS
604+
return name in SORT_ORDERS
605605

606606
@staticmethod
607607
def output_sort_key(item: Iterable[str]) -> float:

tests/unit/test_config.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,9 @@ def test_check_outputs(tmp_path, registered_outputs, tasks_and_outputs, fails):
17431743
cfg = WorkflowConfig('', tmp_path / 'flow.cylc', '')
17441744
cfg.cfg['runtime']['foo']['outputs'] = registered_outputs
17451745
if fails:
1746-
with pytest.raises(WorkflowConfigError, match='Undefined custom output'):
1747-
cfg.check_outputs(tasks_and_outputs)
1746+
with pytest.raises(
1747+
WorkflowConfigError, match='Undefined custom output'
1748+
):
1749+
cfg.check_terminal_outputs(tasks_and_outputs)
17481750
else:
1749-
assert cfg.check_outputs(tasks_and_outputs) is None
1751+
assert cfg.check_terminal_outputs(tasks_and_outputs) is None

0 commit comments

Comments
 (0)