(case_setup_dap)
| 5968 | |
| 5969 | |
| 5970 | def test_global_scope(case_setup_dap): |
| 5971 | with case_setup_dap.test_file("_debugger_case_globals.py") as writer: |
| 5972 | json_facade = JsonFacade(writer) |
| 5973 | break1 = writer.get_line_index_with_content("breakpoint here") |
| 5974 | break2 = writer.get_line_index_with_content("second breakpoint") |
| 5975 | json_facade.write_set_breakpoints([break1, break2]) |
| 5976 | |
| 5977 | json_facade.write_make_initial_run() |
| 5978 | json_hit = json_facade.wait_for_thread_stopped() |
| 5979 | |
| 5980 | local_var = json_facade.get_global_var(json_hit.frame_id, "in_global_scope") |
| 5981 | assert local_var.value == "'in_global_scope_value'" |
| 5982 | |
| 5983 | scopes_request = json_facade.write_request(pydevd_schema.ScopesRequest(pydevd_schema.ScopesArguments(json_hit.frame_id))) |
| 5984 | scopes_response = json_facade.wait_for_response(scopes_request) |
| 5985 | assert len(scopes_response.body.scopes) == 2 |
| 5986 | assert scopes_response.body.scopes[0]["name"] == "Locals" |
| 5987 | assert scopes_response.body.scopes[1]["name"] == "Globals" |
| 5988 | globals_varreference = scopes_response.body.scopes[1]["variablesReference"] |
| 5989 | |
| 5990 | json_facade.write_set_variable(globals_varreference, "in_global_scope", "'new_value'") |
| 5991 | json_facade.write_continue() |
| 5992 | json_hit2 = json_facade.wait_for_thread_stopped() |
| 5993 | global_var = json_facade.get_global_var(json_hit2.frame_id, "in_global_scope") |
| 5994 | assert global_var.value == "'new_value'" |
| 5995 | json_facade.write_continue() |
| 5996 | |
| 5997 | writer.finished_ok = True |
| 5998 | |
| 5999 | |
| 6000 | def _check_inline_var_presentation(json_facade, json_hit, variables_response): |
nothing calls this directly
no test coverage detected