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

Method _getobj

src/_pytest/python.py:304–309  ·  view source on GitHub ↗

Get the underlying Python object. May be overwritten by subclasses.

(self)

Source from the content-addressed store, hash-verified

302 self._obj = value
303
304 def _getobj(self):
305 """Get the underlying Python object. May be overwritten by subclasses."""
306 # TODO: Improve the type of `parent` such that assert/ignore aren't needed.
307 assert self.parent is not None
308 obj = self.parent.obj # type: ignore[attr-defined]
309 return getattr(obj, self.name)
310
311 def getmodpath(self, stopatmodule: bool = True, includemodule: bool = False) -> str:
312 """Return Python path relative to the containing module."""

Callers 1

objMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected