Skip to content

Commit 40dc92b

Browse files
committed
remove goto cache
1 parent a81bb64 commit 40dc92b

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

codeflash/discovery/discover_unit_tests.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ def _process_single_test_file(
294294
functions: list[TestsInFile],
295295
cfg: TestConfig,
296296
jedi_project: jedi.Project,
297-
goto_cache: dict,
298297
tests_cache: TestsCache,
299298
function_to_test_map: defaultdict,
300299
) -> None:
@@ -400,13 +399,8 @@ def _process_single_test_file(
400399
if scope not in test_functions_by_name:
401400
continue
402401

403-
cache_key = (name.full_name, name.module_name)
404402
try:
405-
if cache_key in goto_cache:
406-
definition = goto_cache[cache_key]
407-
else:
408-
definition = name.goto(follow_imports=True, follow_builtin_imports=False)
409-
goto_cache[cache_key] = definition
403+
definition = name.goto(follow_imports=True, follow_builtin_imports=False)
410404
except Exception as e:
411405
logger.debug(str(e))
412406
continue
@@ -467,17 +461,14 @@ def process_test_files(
467461
) -> dict[str, list[FunctionCalledInTest]]:
468462
function_to_test_map = defaultdict(set)
469463
jedi_project = jedi.Project(path=cfg.project_root_path)
470-
goto_cache = {}
471464
tests_cache = TestsCache()
472465

473466
with test_files_progress_bar(total=len(file_to_test_map), description="Processing test files") as (
474467
progress,
475468
task_id,
476469
):
477470
for test_file, functions in file_to_test_map.items():
478-
_process_single_test_file(
479-
test_file, functions, cfg, jedi_project, goto_cache, tests_cache, function_to_test_map
480-
)
471+
_process_single_test_file(test_file, functions, cfg, jedi_project, tests_cache, function_to_test_map)
481472
progress.advance(task_id)
482473

483474
tests_cache.close()

0 commit comments

Comments
 (0)