Skip to content

Commit a882273

Browse files
committed
Update test_unit_test_discovery.py
1 parent 57ec145 commit a882273

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

tests/test_unit_test_discovery.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,13 +1079,10 @@ def test_other():
10791079
mock_function.function_name = "target_function"
10801080
mock_function.parents = [] # No parent classes
10811081

1082-
filtered_tests = discover_unit_tests(test_config, functions_to_optimize=[mock_function])
1083-
# The import filter is designed for high recall, so it may include both functions
1084-
# because both test files import from the same module (mycode) that contains target_function
1085-
assert len(filtered_tests) >= 1 # Should find at least target_function
1082+
dummy_file_path = Path("dummy.py")
1083+
filtered_tests = discover_unit_tests(test_config, file_to_funcs_to_optimize={dummy_file_path: [mock_function]})
1084+
assert len(filtered_tests) >= 1
10861085
assert "mycode.target_function" in filtered_tests
1087-
# In a perfect world we'd filter out other_function, but conservative filtering
1088-
# is acceptable for performance optimization purposes
10891086

10901087

10911088
def test_analyze_imports_conditional_import():

0 commit comments

Comments
 (0)