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

Method obj

src/_pytest/python.py:286–298  ·  view source on GitHub ↗

Underlying Python object.

(self)

Source from the content-addressed store, hash-verified

284
285 @property
286 def obj(self):
287 """Underlying Python object."""
288 obj = getattr(self, "_obj", None)
289 if obj is None:
290 self._obj = obj = self._getobj()
291 # XXX evil hack
292 # used to avoid Function marker duplication
293 if self._ALLOW_MARKERS:
294 self.own_markers.extend(get_unpacked_marks(self.obj))
295 # This assumes that `obj` is called before there is a chance
296 # to add custom keys to `self.keywords`, so no fear of overriding.
297 self.keywords.update((mark.name, mark) for mark in self.own_markers)
298 return obj
299
300 @obj.setter
301 def obj(self, value):

Callers 4

newinstanceMethod · 0.80
newinstanceMethod · 0.80
_getinstanceMethod · 0.80

Calls 3

_getobjMethod · 0.95
get_unpacked_marksFunction · 0.90
updateMethod · 0.80

Tested by 3

newinstanceMethod · 0.64
_getinstanceMethod · 0.64