MCPcopy
hub / github.com/pytest-dev/pytest / iter_parents

Method iter_parents

src/_pytest/nodes.py:286–295  ·  view source on GitHub ↗

Iterate over all parent collectors starting from and including self up to the root of the collection tree. .. versionadded:: 8.1

(self)

Source from the content-addressed store, hash-verified

284 pass
285
286 def iter_parents(self) -> Iterator[Node]:
287 """Iterate over all parent collectors starting from and including self
288 up to the root of the collection tree.
289
290 .. versionadded:: 8.1
291 """
292 parent: Node | None = self
293 while parent is not None:
294 yield parent
295 parent = parent.parent
296
297 def listchain(self) -> list[Node]:
298 """Return a list of all parent collectors starting from the root of the

Callers 6

getparentMethod · 0.95
getmodpathMethod · 0.80
get_scope_packageFunction · 0.80
_matchfactoriesMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected