MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / test_evaluate_no_double_exec

Function test_evaluate_no_double_exec

tests_python/test_debugger_json.py:2732–2764  ·  view source on GitHub ↗
(case_setup_dap, pyfile)

Source from the content-addressed store, hash-verified

2730
2731
2732def test_evaluate_no_double_exec(case_setup_dap, pyfile):
2733
2734 @pyfile
2735 def exec_code():
2736
2737 def print_and_raise():
2738 print("Something")
2739 raise RuntimeError()
2740
2741 print("Break here")
2742 print("TEST SUCEEDED!")
2743
2744 with case_setup_dap.test_file(exec_code) as writer:
2745 json_facade = JsonFacade(writer)
2746 json_facade.write_launch(justMyCode=False)
2747 json_facade.write_set_breakpoints(writer.get_line_index_with_content("Break here"))
2748 json_facade.write_make_initial_run()
2749
2750 json_hit = json_facade.wait_for_thread_stopped()
2751 json_hit = json_facade.get_stack_as_json_hit(json_hit.thread_id)
2752
2753 json_facade.evaluate(
2754 "print_and_raise()",
2755 frameId=json_hit.frame_id,
2756 context="repl",
2757 success=False,
2758 )
2759
2760 messages = json_facade.mark_messages(OutputEvent, lambda output_event: "Something" in output_event.body.output)
2761 assert len(messages) == 1
2762
2763 json_facade.write_continue()
2764 writer.finished_ok = True
2765
2766
2767def test_evaluate_variable_references(case_setup_dap):

Callers

nothing calls this directly

Calls 11

write_launchMethod · 0.95
write_set_breakpointsMethod · 0.95
get_stack_as_json_hitMethod · 0.95
evaluateMethod · 0.95
mark_messagesMethod · 0.95
write_continueMethod · 0.95
JsonFacadeClass · 0.85
test_fileMethod · 0.80

Tested by

no test coverage detected