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

Method instance

src/_pytest/python.py:1673–1682  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1671
1672 @property
1673 def instance(self):
1674 try:
1675 return self._instance
1676 except AttributeError:
1677 if isinstance(self.parent, Class):
1678 # Each Function gets a fresh class instance.
1679 self._instance = self._getinstance()
1680 else:
1681 self._instance = None
1682 return self._instance
1683
1684 def _getinstance(self):
1685 if isinstance(self.parent, Class):

Callers

nothing calls this directly

Calls 1

_getinstanceMethod · 0.95

Tested by

no test coverage detected