MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / temp_yaml_files

Function temp_yaml_files

tests/test_per_file_config.py:81–159  ·  view source on GitHub ↗

Create temporary YAML test files.

()

Source from the content-addressed store, hash-verified

79
80@pytest.fixture
81def temp_yaml_files():
82 """Create temporary YAML test files."""
83 with tempfile.TemporaryDirectory() as tmpdir:
84 # Main workflow with config
85 main_yaml = os.path.join(tmpdir, "main_workflow.yaml")
86 with open(main_yaml, "w") as f:
87 f.write("""name: "test_main_workflow"
88goal: "Test main workflow with config"
89
90config:
91 model: "gpt-4o"
92 max_tokens_per_step: 150000
93 max_tool_calls_per_step: 15
94
95parameters:
96 topic: "test topic"
97
98workflow:
99 - step:
100 name: "test_step"
101 instruction: "Do something"
102""")
103
104 # Submodule with custom config
105 submodule_with_config = os.path.join(tmpdir, "submodule_with_config.yaml")
106 with open(submodule_with_config, "w") as f:
107 f.write("""name: "submodule_with_custom_config"
108goal: "Submodule that overrides parent config"
109
110config:
111 model: "gpt-4o-mini"
112 max_tokens_per_step: 50000
113
114parameters:
115 input: "${INPUT}"
116
117workflow:
118 - step:
119 name: "sub_step"
120 instruction: "Process input"
121""")
122
123 # Submodule without config (inherits parent)
124 submodule_no_config = os.path.join(tmpdir, "submodule_no_config.yaml")
125 with open(submodule_no_config, "w") as f:
126 f.write("""name: "submodule_inherits_config"
127goal: "Submodule that inherits parent config"
128
129parameters:
130 data: "${DATA}"
131
132workflow:
133 - step:
134 name: "inherit_step"
135 instruction: "Use parent config"
136""")
137
138 # YAML without config section

Callers

nothing calls this directly

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected