Skip to content

Commit 337b0ee

Browse files
committed
use qualified name from functiontooptimize object
1 parent 918dd68 commit 337b0ee

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

codeflash/discovery/discover_unit_tests.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -475,18 +475,10 @@ def process_test_files(
475475
project_root_path = cfg.project_root_path
476476
test_framework = cfg.test_framework
477477

478-
# Apply import filter if functions to optimize are provided
479478
if functions_to_optimize:
480-
# Extract target function names from FunctionToOptimize objects
481-
# Include both qualified names and simple function names for better matching
482479
target_function_names = set()
483480
for func in functions_to_optimize:
484-
target_function_names.add(func.qualified_name_with_modules_from_root(project_root_path))
485-
target_function_names.add(func.function_name) # Add simple name too
486-
# Also add qualified name without module
487-
if func.parents:
488-
target_function_names.add(f"{func.parents[0].name}.{func.function_name}")
489-
481+
target_function_names.add(func.qualified_name)
490482
logger.debug(f"Target functions for import filtering: {target_function_names}")
491483
file_to_test_map, import_results = filter_test_files_by_imports(file_to_test_map, target_function_names)
492484
logger.debug(f"Import analysis results: {len(import_results)} files analyzed")

0 commit comments

Comments
 (0)