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

Function test_hasattr_failure

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

Source from the content-addressed store, hash-verified

2131
2132
2133def test_hasattr_failure(case_setup_dap):
2134 with case_setup_dap.test_file("_debugger_case_hasattr_crash.py") as writer:
2135 json_facade = JsonFacade(writer)
2136
2137 writer.write_add_breakpoint(writer.get_line_index_with_content("break here"))
2138 json_facade.write_make_initial_run()
2139
2140 json_hit = json_facade.wait_for_thread_stopped()
2141 json_hit = json_facade.get_stack_as_json_hit(json_hit.thread_id)
2142
2143 variables_response = json_facade.get_variables_response(json_hit.frame_id)
2144
2145 for variable in variables_response.body.variables:
2146 if variable["evaluateName"] == "obj":
2147 break
2148 else:
2149 raise AssertionError('Did not find "obj" in %s' % (variables_response.body.variables,))
2150
2151 evaluate_response = json_facade.evaluate("obj", json_hit.frame_id, context="hover")
2152 evaluate_response_body = evaluate_response.body.to_dict()
2153 assert evaluate_response_body["result"] == "An exception was raised: RuntimeError()"
2154
2155 json_facade.evaluate("not_there", json_hit.frame_id, context="hover", success=False)
2156 json_facade.evaluate("not_there", json_hit.frame_id, context="watch", success=False)
2157
2158 json_facade.write_continue()
2159
2160 writer.finished_ok = True
2161
2162
2163def test_getattr_warning(case_setup_dap):

Callers

nothing calls this directly

Calls 11

get_stack_as_json_hitMethod · 0.95
evaluateMethod · 0.95
write_continueMethod · 0.95
JsonFacadeClass · 0.85
test_fileMethod · 0.80
write_add_breakpointMethod · 0.80
to_dictMethod · 0.45

Tested by

no test coverage detected