MCPcopy Index your code
hub / github.com/fabioz/PyDev.Debugger / test_global_scope

Function test_global_scope

tests_python/test_debugger_json.py:5970–5997  ·  view source on GitHub ↗
(case_setup_dap)

Source from the content-addressed store, hash-verified

5968
5969
5970def 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
6000def _check_inline_var_presentation(json_facade, json_hit, variables_response):

Callers

nothing calls this directly

Calls 11

write_set_breakpointsMethod · 0.95
get_global_varMethod · 0.95
write_requestMethod · 0.95
wait_for_responseMethod · 0.95
write_set_variableMethod · 0.95
write_continueMethod · 0.95
JsonFacadeClass · 0.85
test_fileMethod · 0.80

Tested by

no test coverage detected