Skip to content

Commit 571cfb9

Browse files
committed
disable cache
1 parent 620d0cd commit 571cfb9

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

codeflash/discovery/discover_unit_tests.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -298,27 +298,12 @@ def process_test_files(
298298

299299
function_to_test_map = defaultdict(set)
300300
jedi_project = jedi.Project(path=project_root_path)
301-
tests_cache = TestsCache()
302301

303302
with test_files_progress_bar(total=len(file_to_test_map), description="Processing test files") as (
304303
progress,
305304
task_id,
306305
):
307306
for test_file, functions in file_to_test_map.items():
308-
file_hash = TestsCache.compute_file_hash(test_file)
309-
cached_tests = tests_cache.get_tests_for_file(str(test_file), file_hash)
310-
if cached_tests:
311-
self_cur = tests_cache.cur
312-
self_cur.execute(
313-
"SELECT qualified_name_with_modules_from_root FROM discovered_tests WHERE file_path = ? AND file_hash = ?",
314-
(str(test_file), file_hash),
315-
)
316-
qualified_names = [row[0] for row in self_cur.fetchall()]
317-
for cached, qualified_name in zip(cached_tests, qualified_names):
318-
function_to_test_map[qualified_name].add(cached)
319-
progress.advance(task_id)
320-
continue
321-
322307
try:
323308
script = jedi.Script(path=test_file, project=jedi_project)
324309
test_functions = set()
@@ -443,18 +428,6 @@ def process_test_files(
443428
)
444429
qualified_name_with_modules_from_root = f"{module_name_from_file_path(definition[0].module_path, project_root_path)}.{full_name_without_module_prefix}"
445430

446-
tests_cache.insert_test(
447-
file_path=str(test_file),
448-
file_hash=file_hash,
449-
qualified_name_with_modules_from_root=qualified_name_with_modules_from_root,
450-
function_name=scope,
451-
test_class=scope_test_class,
452-
test_function=scope_test_function,
453-
test_type=test_type,
454-
line_number=name.line,
455-
col_number=name.column,
456-
)
457-
458431
function_to_test_map[qualified_name_with_modules_from_root].add(
459432
FunctionCalledInTest(
460433
tests_in_file=TestsInFile(
@@ -469,7 +442,6 @@ def process_test_files(
469442

470443
progress.advance(task_id)
471444

472-
tests_cache.close()
473445
function_to_tests_dict = {function: list(tests) for function, tests in function_to_test_map.items()}
474446
num_discovered_tests = sum(len(tests) for tests in function_to_tests_dict.values())
475447
return function_to_tests_dict, num_discovered_tests

0 commit comments

Comments
 (0)