Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions codeflash/code_utils/concolic_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ def __init__(self) -> None:

def clean_concolic_tests(test_suite_code: str) -> str:
try:
can_parse = True
tree = ast.parse(test_suite_code)
except SyntaxError:
can_parse = True
except Exception:
can_parse = False
tree = None

if not can_parse:
return AssertCleanup().transform_asserts(test_suite_code)
Expand All @@ -87,7 +88,6 @@ def clean_concolic_tests(test_suite_code: str) -> str:
new_body.append(ast.Expr(value=stmt.test.left))
else:
new_body.append(stmt)

else:
new_body.append(stmt)
node.body = new_body
Expand Down
5 changes: 5 additions & 0 deletions codeflash/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ def main(args: Namespace | None = None) -> ArgumentParser:
replay_test_paths = []
if parsed_args.module and unknown_args[0] == "pytest":
pytest_splits, test_paths = pytest_split(unknown_args[1:])
if pytest_splits is None or test_paths is None:
console.print(f"❌ Could not find test files in the specified paths: {unknown_args[1:]}")
console.print(f"Current working directory: {Path.cwd()}")
console.print("Please ensure the test directory exists and contains test files.")
sys.exit(1)

if len(pytest_splits) > 1:
processes = []
Expand Down
Loading