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

Method collect_by_name

src/_pytest/pytester.py:1333–1347  ·  view source on GitHub ↗

Return the collection node for name from the module collection. Searches a module collection node for a collection node matching the given name. :param modcol: A module collection node; see :py:meth:`getmodulecol`. :param name: The name of the node to return.

(self, modcol: Collector, name: str)

Source from the content-addressed store, hash-verified

1331 return self.getnode(config, path)
1332
1333 def collect_by_name(self, modcol: Collector, name: str) -> Item | Collector | None:
1334 """Return the collection node for name from the module collection.
1335
1336 Searches a module collection node for a collection node matching the
1337 given name.
1338
1339 :param modcol: A module collection node; see :py:meth:`getmodulecol`.
1340 :param name: The name of the node to return.
1341 """
1342 if modcol not in self._mod_collections:
1343 self._mod_collections[modcol] = list(modcol.collect())
1344 for colitem in self._mod_collections[modcol]:
1345 if colitem.name == name:
1346 return colitem
1347 return None
1348
1349 def popen(
1350 self,

Calls 1

collectMethod · 0.45

Tested by

no test coverage detected