(case_setup_dap)
| 2131 | |
| 2132 | |
| 2133 | def 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 | |
| 2163 | def test_getattr_warning(case_setup_dap): |
nothing calls this directly
no test coverage detected