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

Method _getautousenames

src/_pytest/fixtures.py:1831–1840  ·  view source on GitHub ↗

Return the names of autouse fixtures applicable to node.

(self, node: nodes.Node)

Source from the content-addressed store, hash-verified

1829 self._pending_conftests.clear()
1830
1831 def _getautousenames(self, node: nodes.Node) -> Iterator[str]:
1832 """Return the names of autouse fixtures applicable to node."""
1833 for parentnode in node.listchain():
1834 basenames = self._node_autousenames.get(parentnode)
1835 if basenames:
1836 yield from basenames
1837 # Legacy fallback: check string-based nodeid autouse names.
1838 nodeid_basenames = self._nodeid_autousenames.get(parentnode.nodeid)
1839 if nodeid_basenames:
1840 yield from nodeid_basenames
1841
1842 def _getusefixturesnames(self, node: nodes.Item) -> Iterator[str]:
1843 """Return the names of usefixtures fixtures applicable to node."""

Callers 1

getfixtureinfoMethod · 0.95

Calls 2

listchainMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected