Skip to content

Commit 314d120

Browse files
eleanorjboydCopilot
andcommitted
Iterate Children container via .values() in compact_test_node
The Children class doesn't implement __iter__, so iterating it directly raised TypeError during pytest discovery, causing the discovery payload to surface as status='error' in end-to-end tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8ea6da5 commit 314d120

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

python_files/vscode_pytest/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,9 +1043,10 @@ def compact_test_node(
10431043
elif key in {"id_", "runID"}:
10441044
compact_node[key] = compact_test_id(cast("str", value), id_base)
10451045
elif key == "children":
1046+
children_iter = value.values() if isinstance(value, Children) else value
10461047
compact_node[key] = [
10471048
compact_test_node(child, path_base, id_base)
1048-
for child in cast("list[TestNode | TestItem | None]", value)
1049+
for child in cast("list[TestNode | TestItem | None]", children_iter)
10491050
]
10501051
else:
10511052
compact_node[key] = value

0 commit comments

Comments
 (0)