@@ -19,38 +19,41 @@ def test_compact_discovery_payload_keeps_absolute_tree_until_return(tmp_path, mo
1919 base_path = tmp_path / "workspace"
2020 test_file = base_path / "tests" / "test_sample.py"
2121 absolute_test_id = f"{ os .fspath (test_file )} ::test_case[param]"
22- session_node : vscode_pytest .TestNode = {
23- "name" : "workspace" ,
24- "path" : base_path ,
25- "type_" : "folder" ,
26- "id_" : os .fspath (base_path ),
27- "children" : [
28- {
29- "name" : "test_sample.py" ,
30- "path" : test_file ,
31- "type_" : "file" ,
32- "id_" : os .fspath (test_file ),
33- "children" : [
34- {
35- "name" : "test_case[param]" ,
36- "path" : test_file ,
37- "type_" : "test" ,
38- "id_" : absolute_test_id ,
39- "runID" : absolute_test_id ,
40- "lineno" : "7" ,
41- }
42- ],
43- }
44- ],
45- }
22+ session_node = cast (
23+ "vscode_pytest.TestNode" ,
24+ {
25+ "name" : "workspace" ,
26+ "path" : base_path ,
27+ "type_" : "folder" ,
28+ "id_" : os .fspath (base_path ),
29+ "children" : [
30+ {
31+ "name" : "test_sample.py" ,
32+ "path" : test_file ,
33+ "type_" : "file" ,
34+ "id_" : os .fspath (test_file ),
35+ "children" : [
36+ {
37+ "name" : "test_case[param]" ,
38+ "path" : test_file ,
39+ "type_" : "test" ,
40+ "id_" : absolute_test_id ,
41+ "runID" : absolute_test_id ,
42+ "lineno" : "7" ,
43+ }
44+ ],
45+ }
46+ ],
47+ },
48+ )
4649
4750 payload = vscode_pytest .create_compact_discovery_payload (os .fspath (base_path ), session_node )
4851
4952 assert session_node ["path" ] == base_path
50- file_node = cast ("vscode_pytest.TestNode" , session_node ["children" ][0 ])
53+ file_node = cast ("vscode_pytest.TestNode" , cast ( "List[Any]" , session_node ["children" ]) [0 ])
5154 assert file_node is not None
5255 assert file_node ["path" ] == test_file
53- test_node = cast ("vscode_pytest.TestItem" , file_node ["children" ][0 ])
56+ test_node = cast ("vscode_pytest.TestItem" , cast ( "List[Any]" , file_node ["children" ]) [0 ])
5457 assert test_node is not None
5558 assert test_node ["id_" ] == absolute_test_id
5659
0 commit comments