@@ -294,23 +294,10 @@ def _process_single_test_file(
294294 functions : list [TestsInFile ],
295295 cfg : TestConfig ,
296296 jedi_project : jedi .Project ,
297- tests_cache : TestsCache ,
298297 function_to_test_map : defaultdict ,
299298) -> None :
300299 project_root_path = cfg .project_root_path
301300 test_framework = cfg .test_framework
302- file_hash = TestsCache .compute_file_hash (test_file )
303- cached_tests = tests_cache .get_tests_for_file (str (test_file ), file_hash )
304- if cached_tests :
305- self_cur = tests_cache .cur
306- self_cur .execute (
307- "SELECT qualified_name_with_modules_from_root FROM discovered_tests WHERE file_path = ? AND file_hash = ?" ,
308- (str (test_file ), file_hash ),
309- )
310- qualified_names = [row [0 ] for row in self_cur .fetchall ()]
311- for cached , qualified_name in zip (cached_tests , qualified_names ):
312- function_to_test_map [qualified_name ].add (cached )
313- return
314301
315302 try :
316303 script = jedi .Script (path = test_file , project = jedi_project )
@@ -431,18 +418,6 @@ def _process_single_test_file(
431418 )
432419 qualified_name_with_modules_from_root = f"{ module_name_from_file_path (definition [0 ].module_path , project_root_path )} .{ full_name_without_module_prefix } "
433420
434- tests_cache .insert_test (
435- file_path = str (test_file ),
436- file_hash = file_hash ,
437- qualified_name_with_modules_from_root = qualified_name_with_modules_from_root ,
438- function_name = scope ,
439- test_class = scope_test_class ,
440- test_function = scope_test_function ,
441- test_type = test_type ,
442- line_number = name .line ,
443- col_number = name .column ,
444- )
445-
446421 function_to_test_map [qualified_name_with_modules_from_root ].add (
447422 FunctionCalledInTest (
448423 tests_in_file = TestsInFile (
@@ -461,15 +436,13 @@ def process_test_files(
461436) -> dict [str , list [FunctionCalledInTest ]]:
462437 function_to_test_map = defaultdict (set )
463438 jedi_project = jedi .Project (path = cfg .project_root_path )
464- tests_cache = TestsCache ()
465439
466440 with test_files_progress_bar (total = len (file_to_test_map ), description = "Processing test files" ) as (
467441 progress ,
468442 task_id ,
469443 ):
470444 for test_file , functions in file_to_test_map .items ():
471- _process_single_test_file (test_file , functions , cfg , jedi_project , tests_cache , function_to_test_map )
445+ _process_single_test_file (test_file , functions , cfg , jedi_project , function_to_test_map )
472446 progress .advance (task_id )
473447
474- tests_cache .close ()
475448 return {function : list (tests ) for function , tests in function_to_test_map .items ()}
0 commit comments