@@ -531,7 +531,7 @@ def pytest_sessionfinish(session, exitstatus):
531531
532532def construct_nested_folders (
533533 file_nodes_dict : dict [str , TestNode ],
534- session_node : TestNode , # session_node['path'] is a pathlib.Path object
534+ session_node : TestNode ,
535535 session_children_dict : dict [str , TestNode ],
536536) -> dict [str , TestNode ]:
537537 """Iterate through all files and construct them into nested folders.
@@ -557,10 +557,6 @@ def construct_nested_folders(
557557 print (
558558 "[vscode-pytest]: Session path not a parent of test paths, adjusting session node to common parent."
559559 )
560- # IMPORTANT: Use session_node["path"] directly as it's already a pathlib.Path object
561- # Do NOT use get_node_path(session_node["path"]) as get_node_path expects pytest objects,
562- # not Path objects directly.
563- # Convert Path objects to strings for os.path.commonpath
564560 file_path_str : str = str (file_node ["path" ])
565561 session_path_str : str = str (session_node ["path" ])
566562 common_parent = os .path .commonpath ([file_path_str , session_path_str ])
@@ -582,15 +578,15 @@ def construct_nested_folders(
582578
583579
584580def process_parameterized_test (
585- test_case : pytest .Item , # Must have callspec attribute (parameterized test)
581+ test_case : pytest .Item ,
586582 test_node : TestItem ,
587583 function_nodes_dict : dict [str , TestNode ],
588584 file_nodes_dict : dict [str , TestNode ],
589585) -> TestNode :
590586 """Process a parameterized test case and create appropriate function nodes.
591587
592588 Keyword arguments:
593- test_case -- the parameterized pytest test case
589+ test_case -- the parameterized pytest test case; must have callspec attribute
594590 test_node -- the test node created from the test case
595591 function_nodes_dict -- dictionary of function nodes indexed by ID
596592 file_nodes_dict -- dictionary of file nodes indexed by path
@@ -739,9 +735,9 @@ def build_test_tree(session: pytest.Session) -> TestNode:
739735
740736
741737def build_nested_folders (
742- file_node : TestNode , # A file node to build folders for
743- created_files_folders_dict : dict [str , TestNode ], # Cache of created folders indexed by path
744- session_node : TestNode , # The session node containing path information
738+ file_node : TestNode ,
739+ created_files_folders_dict : dict [str , TestNode ],
740+ session_node : TestNode ,
745741) -> TestNode :
746742 """Takes a file or folder and builds the nested folder structure for it.
747743
0 commit comments