Skip to content

Commit b4b1c47

Browse files
AAgnihotryclaude
andcommitted
fix: generate pyproject for init tests
The init command requires a pyproject.toml file to exist. Added _generate_pyproject() helper method to create a minimal pyproject.toml in both test methods, matching the pattern used in llamaindex tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent d7a61e4 commit b4b1c47

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

packages/uipath-openai-agents/tests/cli/test_init.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
class TestInit:
1111
"""Test init command for OpenAI agents."""
1212

13+
def _generate_pyproject(self):
14+
with open("pyproject.toml", "w") as f:
15+
f.write(
16+
'[project]\nname = "test-project"\nversion = "0.1.0"\n'
17+
'description = "Test"\nauthors = [{name = "Test"}]\n'
18+
'requires-python = ">=3.11"\n'
19+
)
20+
1321
def test_init_basic_config_generation(
1422
self,
1523
runner: CliRunner,
@@ -30,6 +38,8 @@ def test_init_basic_config_generation(
3038
with open("openai_agents.json", "w") as f:
3139
f.write(openai_agents_config)
3240

41+
self._generate_pyproject()
42+
3343
result = runner.invoke(cli, ["init"])
3444
assert result.exit_code == 0
3545
assert os.path.exists("entry-points.json")
@@ -87,6 +97,8 @@ def test_init_translation_agent_config_generation(
8797
with open("openai_agents.json", "w") as f:
8898
f.write(openai_agents_config)
8999

100+
self._generate_pyproject()
101+
90102
result = runner.invoke(cli, ["init"])
91103
assert result.exit_code == 0
92104
assert os.path.exists("entry-points.json")

0 commit comments

Comments
 (0)