mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-01-31 11:54:30 +01:00
fix(benchmark): Fix TestResult.fail_reason assignment condition
The condition must be the same as for `success`, because otherwise it causes a crash when `call.excinfo` evaluates to `False` but is not `None`.
This commit is contained in:
@@ -90,7 +90,7 @@ def add_test_result_to_report(
|
||||
TestResult(
|
||||
success=call.excinfo is None,
|
||||
run_time=f"{str(round(call.duration, 3))} seconds",
|
||||
fail_reason=str(call.excinfo.value) if call.excinfo else None,
|
||||
fail_reason=None if call.excinfo is None else str(call.excinfo.value),
|
||||
reached_cutoff=user_properties.get("timed_out", False),
|
||||
n_steps=user_properties.get("n_steps"),
|
||||
cost=user_properties.get("agent_task_cost"),
|
||||
|
||||
Reference in New Issue
Block a user