MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / test_func_code_info

Function test_func_code_info

tests_python/test_frame_evaluator.py:62–81  ·  view source on GitHub ↗
(_times, _custom_global_dbg)

Source from the content-addressed store, hash-verified

60
61@pytest.mark.parametrize("_times", range(2))
62def test_func_code_info(_times, _custom_global_dbg):
63 from _pydevd_frame_eval import pydevd_frame_evaluator
64
65 # Must be called before get_func_code_info_py to initialize the _code_extra_index.
66 thread_info = pydevd_frame_evaluator.get_thread_info_py()
67
68 func_info = pydevd_frame_evaluator.get_func_code_info_py(thread_info, method(), method.__code__)
69 assert func_info.co_filename is method.__code__.co_filename
70 func_info2 = pydevd_frame_evaluator.get_func_code_info_py(thread_info, method(), method.__code__)
71 assert func_info is func_info2
72
73 some_func = eval("lambda:sys._getframe()")
74 func_info3 = pydevd_frame_evaluator.get_func_code_info_py(thread_info, some_func(), some_func.__code__)
75 del some_func
76 del func_info3
77
78 some_func = eval("lambda:sys._getframe()")
79 pydevd_frame_evaluator.get_func_code_info_py(thread_info, some_func(), some_func.__code__)
80 func_info = pydevd_frame_evaluator.get_func_code_info_py(thread_info, some_func(), some_func.__code__)
81 assert pydevd_frame_evaluator.get_func_code_info_py(thread_info, some_func(), some_func.__code__) is func_info
82
83
84def test_generate_code_with_breakpoints():

Callers

nothing calls this directly

Calls 2

some_funcFunction · 0.85
methodFunction · 0.70

Tested by

no test coverage detected