Skip to content

Commit 0aa3d20

Browse files
Merge pull request #825 from codeflash-ai/concolic-error
CF-753 catch all exceptions for concolic cleanup
2 parents 07417ba + 6525f99 commit 0aa3d20

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

codeflash/code_utils/concolic_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,11 @@ def __init__(self) -> None:
7070

7171
def clean_concolic_tests(test_suite_code: str) -> str:
7272
try:
73-
can_parse = True
7473
tree = ast.parse(test_suite_code)
75-
except SyntaxError:
74+
can_parse = True
75+
except Exception:
7676
can_parse = False
77+
tree = None
7778

7879
if not can_parse:
7980
return AssertCleanup().transform_asserts(test_suite_code)
@@ -87,7 +88,6 @@ def clean_concolic_tests(test_suite_code: str) -> str:
8788
new_body.append(ast.Expr(value=stmt.test.left))
8889
else:
8990
new_body.append(stmt)
90-
9191
else:
9292
new_body.append(stmt)
9393
node.body = new_body

codeflash/tracer.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ def main(args: Namespace | None = None) -> ArgumentParser:
103103
replay_test_paths = []
104104
if parsed_args.module and unknown_args[0] == "pytest":
105105
pytest_splits, test_paths = pytest_split(unknown_args[1:])
106+
if pytest_splits is None or test_paths is None:
107+
console.print(f"❌ Could not find test files in the specified paths: {unknown_args[1:]}")
108+
console.print(f"Current working directory: {Path.cwd()}")
109+
console.print("Please ensure the test directory exists and contains test files.")
110+
sys.exit(1)
106111

107112
if len(pytest_splits) > 1:
108113
processes = []

0 commit comments

Comments
 (0)