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

Method listchain

src/_pytest/nodes.py:297–306  ·  view source on GitHub ↗

Return a list of all parent collectors starting from the root of the collection tree down to and including self.

(self)

Source from the content-addressed store, hash-verified

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
299 collection tree down to and including self."""
300 chain = []
301 item: Node | None = self
302 while item is not None:
303 chain.append(item)
304 item = item.parent
305 chain.reverse()
306 return chain
307
308 def add_marker(self, marker: str | MarkDecorator, append: bool = True) -> None:
309 """Dynamically add a marker object to the node.

Callers 11

listextrakeywordsMethod · 0.95
listnamesMethod · 0.95
_printcollecteditemsMethod · 0.80
setupMethod · 0.80
teardown_exactMethod · 0.80
_getautousenamesMethod · 0.80
from_itemMethod · 0.80
test_global_fileMethod · 0.80
test_pkgfileMethod · 0.80

Calls 1

appendMethod · 0.80