Skip to content

Commit 9c4c08f

Browse files
committed
Issue #397 fix
1 parent 133d173 commit 9c4c08f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Changelog
22

33
## [Unreleased]
4+
### Fixed
5+
- Issue [#397](https://github.com/reportportal/agent-python-pytest/issues/397) pytest launch stuck with xdist, by @HardNorth
46

57
## [5.5.1]
68
### Added

pytest_reportportal/service.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,14 @@ def _merge_code(self, test_tree: Dict[str, Any]) -> None:
433433
self._merge_code_with_separator(test_tree, "::")
434434

435435
def _build_item_paths(self, leaf: Dict[str, Any], path: List[Dict[str, Any]]) -> None:
436-
if "children" in leaf and len(leaf["children"]) > 0:
436+
children = leaf.get("children", {})
437+
all_background_steps = all([isinstance(child, Background) for child in children.keys()])
438+
if len(children) > 0 and not all_background_steps:
437439
path.append(leaf)
438440
for name, child_leaf in leaf["children"].items():
439441
self._build_item_paths(child_leaf, path)
440442
path.pop()
441-
if leaf["type"] != LeafType.ROOT:
443+
elif leaf["type"] != LeafType.ROOT:
442444
self._tree_path[leaf["item"]] = path + [leaf]
443445

444446
@check_rp_enabled

0 commit comments

Comments
 (0)