@@ -519,6 +519,12 @@ def task_example() -> Annotated[Dict[str, str], PythonNode(name="result")]:
519519 tmp_path .joinpath ("task_module.py" ).write_text (textwrap .dedent (source ))
520520 result = runner .invoke (cli , [tmp_path .as_posix ()])
521521 assert result .exit_code == ExitCode .OK
522+ assert "1 Succeeded" in result .output
523+
524+ # Test that python nodes are recreated every run.
525+ result = runner .invoke (cli , [tmp_path .as_posix ()])
526+ assert result .exit_code == ExitCode .OK
527+ assert "1 Succeeded" in result .output
522528
523529
524530@pytest .mark .end_to_end ()
@@ -544,10 +550,6 @@ def task_example() -> Annotated[Dict[str, str], nodes]:
544550 assert result .exit_code == ExitCode .OK
545551 assert "1 Succeeded" in result .output
546552
547- result = runner .invoke (cli , [tmp_path .as_posix ()])
548- assert result .exit_code == ExitCode .OK
549- assert "1 Skipped" in result .output
550-
551553
552554@pytest .mark .end_to_end ()
553555def test_more_nested_pytree_and_python_node_as_return (runner , tmp_path ):
@@ -568,15 +570,10 @@ def task_example() -> Annotated[Dict[str, str], nodes]:
568570 assert result .exit_code == ExitCode .OK
569571 assert "1 Succeeded" in result .output
570572
571- result = runner .invoke (cli , [tmp_path .as_posix ()])
572- assert result .exit_code == ExitCode .OK
573- assert "1 Skipped" in result .output
574-
575573
576574@pytest .mark .end_to_end ()
577575def test_execute_tasks_and_pass_values_only_by_python_nodes (runner , tmp_path ):
578576 source = """
579- from pytask import PathNode
580577 from pytask import PythonNode
581578 from typing_extensions import Annotated
582579 from pathlib import Path
@@ -586,9 +583,9 @@ def test_execute_tasks_and_pass_values_only_by_python_nodes(runner, tmp_path):
586583 def task_create_text() -> Annotated[int, node_text]:
587584 return "This is the text."
588585
589- node_file = PathNode(path=Path("file.txt"))
590-
591- def task_create_file(text: Annotated[int, node_text] ) -> Annotated[str, node_file ]:
586+ def task_create_file(
587+ text: Annotated[int, node_text]
588+ ) -> Annotated[str, Path("file.txt") ]:
592589 return text
593590 """
594591 tmp_path .joinpath ("task_module.py" ).write_text (textwrap .dedent (source ))
@@ -611,9 +608,9 @@ def test_execute_tasks_via_functional_api(tmp_path):
611608 def create_text() -> Annotated[int, node_text]:
612609 return "This is the text."
613610
614- node_file = PathNode(path=Path("file.txt"))
615-
616- def create_file(content: Annotated[str, node_text] ) -> Annotated[str, node_file ]:
611+ def create_file(
612+ content: Annotated[str, node_text]
613+ ) -> Annotated[str, Path("file.txt") ]:
617614 return content
618615
619616 if __name__ == "__main__":
0 commit comments