2424# This import must happen before other invoke imports or test in other files(!!) break
2525from tests .test_nodes import (
2626 AnyTypeTestInvocation ,
27+ AnyTypeTestInvocationOutput ,
2728 PromptCollectionTestInvocation ,
2829 PromptTestInvocation ,
2930 TextToImageTestInvocation ,
@@ -915,9 +916,14 @@ def test_prepare_if_inputs_raises_when_selected_branch_source_has_no_result():
915916 g ._resolved_if_exec_branches [if_exec_id ] = "true_input"
916917
917918 if_node = g .execution_graph .get_node (if_exec_id )
918- with pytest .raises (RuntimeError , match = "selected input edge" ) :
919+ with pytest .raises (RuntimeError ) as exc_info :
919920 g ._prepare_inputs (if_node )
920921
922+ message = str (exc_info .value )
923+ assert if_exec_id in message
924+ assert true_value_exec_id in message
925+ assert "iteration_path=()" in message
926+
921927
922928def test_get_collect_iteration_mappings_ignores_skipped_prepared_exec_nodes ():
923929 graph = Graph ()
@@ -1025,7 +1031,7 @@ def test_mark_exec_node_skipped_does_not_hide_already_executed_results():
10251031 g = GraphExecutionState (graph = graph )
10261032
10271033 exec_id = g ._create_execution_node ("value" , [])[0 ]
1028- g .results [exec_id ] = AnyTypeTestInvocation ( id = "result" , value = "value" ). invoke ( Mock ( InvocationContext ) )
1034+ g .results [exec_id ] = AnyTypeTestInvocationOutput ( value = "value" )
10291035 g .executed .add (exec_id )
10301036 g ._set_prepared_exec_state (exec_id , "executed" )
10311037
@@ -1035,6 +1041,21 @@ def test_mark_exec_node_skipped_does_not_hide_already_executed_results():
10351041 assert g .results [exec_id ].value == "value"
10361042
10371043
1044+ def test_mark_exec_node_skipped_is_idempotent_for_skipped_state ():
1045+ graph = Graph ()
1046+ graph .add_node (AnyTypeTestInvocation (id = "value" , value = "value" ))
1047+
1048+ g = GraphExecutionState (graph = graph )
1049+
1050+ exec_id = g ._create_execution_node ("value" , [])[0 ]
1051+
1052+ g ._if_scheduler ().mark_exec_node_skipped (exec_id )
1053+ g ._if_scheduler ().mark_exec_node_skipped (exec_id )
1054+
1055+ assert g ._get_prepared_exec_metadata (exec_id ).state == "skipped"
1056+ assert g .executed_history .count ("value" ) == 1
1057+
1058+
10381059def test_are_connection_types_compatible_accepts_subclass_to_base ():
10391060 """A subclass output should be connectable to a base-class input.
10401061
0 commit comments