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

Method from_function

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

Source from the content-addressed store, hash-verified

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

Callers 12

_prunetracebackMethod · 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

Calls 2

getrawcodeFunction · 0.90
clsFunction · 0.85

Tested by 10

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