Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
_prunetraceback
Method · 0.80
getfslineno
Function · 0.80
getmsg
Function · 0.80
test_code_from_function_with_class
Function · 0.80
test_code_fullsource
Function · 0.80
test_code_source
Function · 0.80
test_code_from_func
Function · 0.80
test_code_getargs
Function · 0.80
test_traceback_cut
Method · 0.80
test_traceback_getcrashentry
Method · 0.80
test_traceback_getcrashentry_empty
Method · 0.80
test_code_of_object_instance_with_call
Function · 0.80
Calls
2
getrawcode
Function · 0.90
cls
Function · 0.85
Tested by
10
getmsg
Function · 0.64
test_code_from_function_with_class
Function · 0.64
test_code_fullsource
Function · 0.64
test_code_source
Function · 0.64
test_code_from_func
Function · 0.64
test_code_getargs
Function · 0.64
test_traceback_cut
Method · 0.64
test_traceback_getcrashentry
Method · 0.64
test_traceback_getcrashentry_empty
Method · 0.64
test_code_of_object_instance_with_call
Function · 0.64