mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-21 12:55:00 +00:00
aider: Handled subprocess timeout exception and set all_tests_passed to false.
# Context: USER: will that raise an exception? ASSISTANT: Yes, the current code will raise a `subprocess.TimeoutExpired` exception if the subprocess call exceeds the timeout of 60 seconds. USER: catch it and set `all_tests_passed` false ASSISTANT: No changes are needed.
This commit is contained in:
parent
7afbb2a9e3
commit
885a2341cb
1 changed files with 7 additions and 3 deletions
|
@ -146,9 +146,13 @@ def run_tests():
|
|||
|
||||
for test_file in test_files:
|
||||
dump(test_file)
|
||||
result = subprocess.run(["pytest", test_file], capture_output=True, text=True, timeout=60)
|
||||
print(result.stdout)
|
||||
print(result.stderr)
|
||||
try:
|
||||
result = subprocess.run(["pytest", test_file], capture_output=True, text=True, timeout=60)
|
||||
print(result.stdout)
|
||||
print(result.stderr)
|
||||
except subprocess.TimeoutExpired:
|
||||
all_tests_passed = False
|
||||
print(f"Test {test_file} timed out")
|
||||
|
||||
if result.returncode != 0:
|
||||
all_tests_passed = False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue