Skip to content

Commit 5d82d86

Browse files
committed
rich text output for user to look at
1 parent c002c24 commit 5d82d86

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

codeflash/optimization/function_optimizer.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import annotations
22

3+
import re
4+
35
import ast
46
import concurrent.futures
57
import os
@@ -1186,12 +1188,20 @@ def run_and_parse_tests(
11861188
)
11871189
return TestResults(), None
11881190
if run_result.returncode != 0 and testing_type == TestingMode.BEHAVIOR:
1189-
logger.info(
1191+
logger.debug(
11901192
f"Nonzero return code {run_result.returncode} when running tests in "
11911193
f"{', '.join([str(f.instrumented_behavior_file_path) for f in test_files.test_files])}.\n"
11921194
f"stdout: {run_result.stdout}\n"
11931195
f"stderr: {run_result.stderr}\n"
11941196
)
1197+
if 'ModuleNotFoundError' in run_result.stdout:
1198+
from rich.text import Text
1199+
match = re.search(r'^.*ModuleNotFoundError.*$', run_result.stdout, re.MULTILINE).group()
1200+
panel = Panel(
1201+
Text.from_markup(f"⚠️ {match} ", style="bold red"),
1202+
expand=False,
1203+
)
1204+
console.print(panel)
11951205
if testing_type in {TestingMode.BEHAVIOR, TestingMode.PERFORMANCE}:
11961206
results, coverage_results = parse_test_results(
11971207
test_xml_path=result_file_path,

0 commit comments

Comments
 (0)