File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -1206,15 +1206,13 @@ def test_unrelated():
12061206 all_tests , _ = discover_unit_tests (test_config )
12071207 assert len (all_tests ) == 2 # Should find both functions
12081208
1209- # Test with filtering - create mock FunctionToOptimize objects
1210- from unittest .mock import Mock
1211- mock_function = Mock ()
1212- mock_function .qualified_name_with_modules_from_root .return_value = "target_module.target_function"
1213- mock_function .function_name = "target_function"
1214- mock_function .parents = [] # No parent classes
1215-
1216- filtered_tests , _ = discover_unit_tests (test_config , file_to_funcs_to_optimize = {target_file : [mock_function ]})
1217- # Should filter out the unrelated test since it imports from a different module
1209+ fto = FunctionToOptimize (
1210+ function_name = "target_function" ,
1211+ file_path = target_file ,
1212+ parents = [],
1213+ )
1214+
1215+ filtered_tests , _ = discover_unit_tests (test_config , file_to_funcs_to_optimize = {target_file : [fto ]})
12181216 assert len (filtered_tests ) == 1
12191217 assert "target_module.target_function" in filtered_tests
12201218 assert "unrelated_module.unrelated_function" not in filtered_tests
You can’t perform that action at this time.
0 commit comments