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

Method from_function

src/_pytest/_code/code.py:67–68  ·  view source on GitHub ↗
(cls, obj: object)

Source from the content-addressed store, hash-verified

65
66 @classmethod
67 def from_function(cls, obj: object) -> Code:
68 return cls(getrawcode(obj))
69
70 def __eq__(self, other):
71 return self.raw == other.raw

Callers 11

_traceback_filterMethod · 0.80
getfslinenoFunction · 0.80
getmsgFunction · 0.80
test_code_fullsourceFunction · 0.80
test_code_sourceFunction · 0.80
test_code_from_funcFunction · 0.80
test_code_getargsFunction · 0.80
test_traceback_cutMethod · 0.80
test_getreprcrashMethod · 0.80

Calls 2

getrawcodeFunction · 0.90
clsFunction · 0.85

Tested by 9

getmsgFunction · 0.64
test_code_fullsourceFunction · 0.64
test_code_sourceFunction · 0.64
test_code_from_funcFunction · 0.64
test_code_getargsFunction · 0.64
test_traceback_cutMethod · 0.64
test_getreprcrashMethod · 0.64