@@ -811,11 +811,9 @@ def test_target():
811
811
test_file .write_text (test_content )
812
812
813
813
target_functions = {"target_function" , "missing_function" }
814
- should_process , found_functions = analyze_imports_in_test_file (test_file , target_functions )
814
+ should_process = analyze_imports_in_test_file (test_file , target_functions )
815
815
816
816
assert should_process is True
817
- assert "target_function" in found_functions
818
- assert "missing_function" not in found_functions
819
817
820
818
821
819
def test_analyze_imports_star_import ():
@@ -831,10 +829,9 @@ def test_something():
831
829
test_file .write_text (test_content )
832
830
833
831
target_functions = {"target_function" }
834
- should_process , found_functions = analyze_imports_in_test_file (test_file , target_functions )
832
+ should_process = analyze_imports_in_test_file (test_file , target_functions )
835
833
836
834
assert should_process is False
837
- assert found_functions == set ()
838
835
839
836
840
837
def test_analyze_imports_module_import ():
@@ -850,10 +847,9 @@ def test_target():
850
847
test_file .write_text (test_content )
851
848
852
849
target_functions = {"target_function" }
853
- should_process , found_functions = analyze_imports_in_test_file (test_file , target_functions )
850
+ should_process = analyze_imports_in_test_file (test_file , target_functions )
854
851
855
852
assert should_process is True
856
- assert "target_function" in found_functions
857
853
858
854
859
855
def test_analyze_imports_dynamic_import ():
@@ -870,10 +866,9 @@ def test_dynamic():
870
866
test_file .write_text (test_content )
871
867
872
868
target_functions = {"target_function" }
873
- should_process , found_functions = analyze_imports_in_test_file (test_file , target_functions )
869
+ should_process = analyze_imports_in_test_file (test_file , target_functions )
874
870
875
871
assert should_process is True
876
- assert "target_function" in found_functions
877
872
878
873
879
874
def test_analyze_imports_builtin_import ():
@@ -888,10 +883,9 @@ def test_builtin_import():
888
883
test_file .write_text (test_content )
889
884
890
885
target_functions = {"target_function" }
891
- should_process , found_functions = analyze_imports_in_test_file (test_file , target_functions )
886
+ should_process = analyze_imports_in_test_file (test_file , target_functions )
892
887
893
888
assert should_process is True
894
- assert "target_function" in found_functions
895
889
896
890
897
891
def test_analyze_imports_no_matching_imports ():
@@ -907,9 +901,8 @@ def test_unrelated():
907
901
test_file .write_text (test_content )
908
902
909
903
target_functions = {"target_function" , "another_function" }
910
- should_process , found_functions = analyze_imports_in_test_file (test_file , target_functions )
904
+ should_process = analyze_imports_in_test_file (test_file , target_functions )
911
905
assert should_process is False
912
- assert found_functions == set ()
913
906
914
907
915
908
def test_analyze_qualified_names ():
@@ -924,9 +917,8 @@ def test_target():
924
917
test_file .write_text (test_content )
925
918
926
919
target_functions = {"target_module.some_function" }
927
- should_process , found_functions = analyze_imports_in_test_file (test_file , target_functions )
920
+ should_process = analyze_imports_in_test_file (test_file , target_functions )
928
921
assert should_process is True
929
- assert "target_module.some_function" in found_functions
930
922
931
923
932
924
@@ -943,11 +935,10 @@ def test_target(
943
935
test_file .write_text (test_content )
944
936
945
937
target_functions = {"target_function" }
946
- should_process , found_functions = analyze_imports_in_test_file (test_file , target_functions )
938
+ should_process = analyze_imports_in_test_file (test_file , target_functions )
947
939
948
940
# Should be conservative with unparseable files
949
941
assert should_process is True
950
- assert found_functions == set ()
951
942
952
943
953
944
def test_filter_test_files_by_imports ():
@@ -1085,10 +1076,9 @@ def test_conditional():
1085
1076
test_file .write_text (test_content )
1086
1077
1087
1078
target_functions = {"target_function" }
1088
- should_process , found_functions = analyze_imports_in_test_file (test_file , target_functions )
1079
+ should_process = analyze_imports_in_test_file (test_file , target_functions )
1089
1080
1090
1081
assert should_process is True
1091
- assert "target_function" in found_functions
1092
1082
1093
1083
1094
1084
def test_analyze_imports_function_name_in_code ():
@@ -1108,10 +1098,9 @@ def test_indirect():
1108
1098
test_file .write_text (test_content )
1109
1099
1110
1100
target_functions = {"target_function" }
1111
- should_process , found_functions = analyze_imports_in_test_file (test_file , target_functions )
1101
+ should_process = analyze_imports_in_test_file (test_file , target_functions )
1112
1102
1113
1103
assert should_process is True
1114
- assert "target_function" in found_functions
1115
1104
1116
1105
1117
1106
def test_analyze_imports_aliased_imports ():
@@ -1128,11 +1117,9 @@ def test_aliased():
1128
1117
test_file .write_text (test_content )
1129
1118
1130
1119
target_functions = {"target_function" , "missing_function" }
1131
- should_process , found_functions = analyze_imports_in_test_file (test_file , target_functions )
1120
+ should_process = analyze_imports_in_test_file (test_file , target_functions )
1132
1121
1133
1122
assert should_process is True
1134
- assert "target_function" in found_functions
1135
- assert "missing_function" not in found_functions
1136
1123
1137
1124
1138
1125
def test_analyze_imports_underscore_function_names ():
@@ -1147,10 +1134,9 @@ def test_bubble():
1147
1134
test_file .write_text (test_content )
1148
1135
1149
1136
target_functions = {"bubble_sort" }
1150
- should_process , found_functions = analyze_imports_in_test_file (test_file , target_functions )
1137
+ should_process = analyze_imports_in_test_file (test_file , target_functions )
1151
1138
1152
1139
assert should_process is False
1153
- assert "bubble_sort" not in found_functions
1154
1140
1155
1141
def test_discover_unit_tests_filtering_different_modules ():
1156
1142
"""Test import filtering with test files from completely different modules."""
0 commit comments