MCPcopy Create free account
hub / github.com/pytest-dev/pytest / getfixturedefs

Method getfixturedefs

src/_pytest/fixtures.py:1665–1678  ·  view source on GitHub ↗

Get a list of fixtures which are applicable to the given node id. :param str argname: Name of the fixture to search for. :param str nodeid: Full node id of the requesting test. :rtype: Sequence[FixtureDef]

(
        self, argname: str, nodeid: str
    )

Source from the content-addressed store, hash-verified

1663 self._nodeid_autousenames.setdefault(nodeid or "", []).extend(autousenames)
1664
1665 def getfixturedefs(
1666 self, argname: str, nodeid: str
1667 ) -> Optional[Sequence[FixtureDef[Any]]]:
1668 """Get a list of fixtures which are applicable to the given node id.
1669
1670 :param str argname: Name of the fixture to search for.
1671 :param str nodeid: Full node id of the requesting test.
1672 :rtype: Sequence[FixtureDef]
1673 """
1674 try:
1675 fixturedefs = self._arg2fixturedefs[argname]
1676 except KeyError:
1677 return None
1678 return tuple(self._matchfactories(fixturedefs, nodeid))
1679
1680 def _matchfactories(
1681 self, fixturedefs: Iterable[FixtureDef[Any]], nodeid: str

Callers 2

getfixtureclosureMethod · 0.95
_getnextfixturedefMethod · 0.80

Calls 1

_matchfactoriesMethod · 0.95

Tested by

no test coverage detected