From f234a04417c4f9517c9f875b31005cff81df64cc Mon Sep 17 00:00:00 2001 From: Kevin Turcios Date: Wed, 15 Oct 2025 16:20:42 -0700 Subject: [PATCH 1/2] just catch all exceptions here --- codeflash/code_utils/concolic_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codeflash/code_utils/concolic_utils.py b/codeflash/code_utils/concolic_utils.py index 81cc71a6c..f59cb7aab 100644 --- a/codeflash/code_utils/concolic_utils.py +++ b/codeflash/code_utils/concolic_utils.py @@ -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) @@ -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 From 9d91209430d4fa7179a2a241c518e06ad333728a Mon Sep 17 00:00:00 2001 From: Kevin Turcios Date: Wed, 15 Oct 2025 18:01:57 -0700 Subject: [PATCH 2/2] clarify error here --- codeflash/tracer.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/codeflash/tracer.py b/codeflash/tracer.py index 7965097e2..733640cee 100644 --- a/codeflash/tracer.py +++ b/codeflash/tracer.py @@ -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 = []