@@ -1401,6 +1401,9 @@ def process_review(
14011401 generated_tests = remove_functions_from_generated_tests (
14021402 generated_tests = generated_tests , test_functions_to_remove = test_functions_to_remove
14031403 )
1404+ map_gen_test_file_to_no_of_tests = original_code_baseline .behavior_test_results .file_to_no_of_tests (
1405+ test_functions_to_remove
1406+ )
14041407
14051408 original_runtime_by_test = original_code_baseline .benchmarking_test_results .usable_runtime_data_by_test_case ()
14061409 optimized_runtime_by_test = (
@@ -1413,11 +1416,12 @@ def process_review(
14131416
14141417 generated_tests_str = ""
14151418 for test in generated_tests .generated_tests :
1416- formatted_generated_test = format_generated_code (
1417- test .generated_original_test_source , self .args .formatter_cmds
1418- )
1419- generated_tests_str += f"```python\n { formatted_generated_test } \n ```"
1420- generated_tests_str += "\n \n "
1419+ if map_gen_test_file_to_no_of_tests [test .behavior_file_path ] > 0 :
1420+ formatted_generated_test = format_generated_code (
1421+ test .generated_original_test_source , self .args .formatter_cmds
1422+ )
1423+ generated_tests_str += f"```python\n { formatted_generated_test } \n ```"
1424+ generated_tests_str += "\n \n "
14211425
14221426 if concolic_test_str :
14231427 formatted_generated_test = format_generated_code (concolic_test_str , self .args .formatter_cmds )
@@ -1537,7 +1541,7 @@ def process_review(
15371541 trace_id = self .function_trace_id , is_optimization_found = best_optimization is not None
15381542 )
15391543
1540- # If worktree mode, do not revert code and helpers,, otherwise we would have an empty diff when writing the patch in the lsp
1544+ # If worktree mode, do not revert code and helpers, otherwise we would have an empty diff when writing the patch in the lsp
15411545 if self .args .worktree :
15421546 return
15431547
0 commit comments