Skip to content

Commit fed6c49

Browse files
committed
Add PYTEST_BDD condition to speed up code a bit without it
1 parent 5e652fa commit fed6c49

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

pytest_reportportal/service.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,10 @@ def _merge_code(self, test_tree: Dict[str, Any]) -> None:
434434

435435
def _build_item_paths(self, leaf: Dict[str, Any], path: List[Dict[str, Any]]) -> None:
436436
children = leaf.get("children", {})
437-
all_background_steps = all([isinstance(child, Background) for child in children.keys()])
437+
if PYTEST_BDD:
438+
all_background_steps = all([isinstance(child, Background) for child in children.keys()])
439+
else:
440+
all_background_steps = False
438441
if len(children) > 0 and not all_background_steps:
439442
path.append(leaf)
440443
for name, child_leaf in leaf["children"].items():

0 commit comments

Comments
 (0)