| 60 | |
| 61 | @pytest.mark.parametrize("_times", range(2)) |
| 62 | def 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 | |
| 84 | def test_generate_code_with_breakpoints(): |