Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions agent/agi.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,12 @@ def call_test(purpose, task, history, directory, action_input):
text=True,
)
if result.returncode != 0:
history += "observation: there are no tests! Test should be written in a test folder under {}\n".format(
directory
)
if "No module named pytest" in result.stderr:
raise Exception("pytest not installed. Please install pytest (pip install pytest)")
else:
history += "observation: there are no tests! Test should be written in a test folder under {}\n".format(
directory
)
return "MAIN", None, history, task
result = subprocess.run(
["python", "-m", "pytest", directory], capture_output=True, text=True
Expand Down