Skip to content

Commit ff924f4

Browse files
fix
1 parent 83f1dea commit ff924f4

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

codeflash/optimization/function_optimizer.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
replace_function_definitions_in_module,
3131
)
3232
from codeflash.code_utils.code_utils import (
33-
ImportErrorPattern,
3433
cleanup_paths,
3534
create_rank_dictionary_compact,
3635
diff_length,
@@ -1612,7 +1611,7 @@ def establish_original_code_baseline(
16121611
)
16131612

16141613
try:
1615-
benchmarking_results = self.run_and_parse_tests(
1614+
benchmarking_results, _ = self.run_and_parse_tests(
16161615
testing_type=TestingMode.PERFORMANCE,
16171616
test_env=test_env,
16181617
test_files=self.test_files,
@@ -1949,17 +1948,18 @@ def run_and_parse_tests(
19491948
f"stderr: {run_result.stderr}\n"
19501949
)
19511950

1952-
if is_LSP_enabled():
1953-
unique_errors = extract_unique_errors(run_result.stdout)
1954-
if unique_errors:
1955-
lsp_log(LspCodeMessage(code="\n".join(unique_errors), file_name="errors"))
1951+
unique_errors = extract_unique_errors(run_result.stdout)
19561952

1957-
if "ModuleNotFoundError" in run_result.stdout:
1953+
if unique_errors:
19581954
from rich.text import Text
19591955

1960-
match = ImportErrorPattern.search(run_result.stdout).group()
1961-
panel = Panel(Text.from_markup(f"⚠️ {match} ", style="bold red"), expand=False)
1962-
console.print(panel)
1956+
for error in unique_errors:
1957+
if is_LSP_enabled():
1958+
lsp_log(LspCodeMessage(code=error, file_name="errors"))
1959+
else:
1960+
panel = Panel(Text.from_markup(f"⚠️ {error} ", style="bold red"), expand=False)
1961+
console.print(panel)
1962+
19631963
if testing_type in {TestingMode.BEHAVIOR, TestingMode.PERFORMANCE}:
19641964
results, coverage_results = parse_test_results(
19651965
test_xml_path=result_file_path,

0 commit comments

Comments
 (0)