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

Method _getobj

src/_pytest/python.py:307–312  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

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

Callers 1

objMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected