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

Function test_show_bytecode_xml

tests_python/test_debugger.py:2432–2459  ·  view source on GitHub ↗
(case_setup, tmpdir)

Source from the content-addressed store, hash-verified

2430
2431@pytest.mark.skipif(not IS_CPYTHON, reason="CPython only test.")
2432def test_show_bytecode_xml(case_setup, tmpdir):
2433 from _pydevd_bundle.pydevd_comm_constants import CMD_LOAD_SOURCE_FROM_FRAME_ID
2434
2435 with case_setup.test_file("_debugger_case_show_bytecode.py") as writer:
2436 writer.write_add_breakpoint(writer.get_line_index_with_content("breakpoint"))
2437 writer.write_make_initial_run()
2438
2439 # First hit is for breakpoint reached via a stack frame that doesn't have source.
2440 hit = writer.wait_for_breakpoint_hit()
2441
2442 writer.write_get_thread_stack(hit.thread_id)
2443 msg = writer.wait_for_get_thread_stack_message()
2444 frame_ids = set()
2445 for frame in msg.thread.frame:
2446 if frame["file"] == "<something>":
2447 frame_ids.add(frame["id"])
2448
2449 assert len(frame_ids) == 2
2450
2451 for frame_id in frame_ids:
2452 writer.write_load_source_from_frame_id(frame_id)
2453 writer.wait_for_message(
2454 lambda msg: "%s\t" % CMD_LOAD_SOURCE_FROM_FRAME_ID in msg and ("MyClass" in msg or "foo()" in msg), expect_xml=False
2455 )
2456
2457 writer.write_run_thread(hit.thread_id)
2458
2459 writer.finished_ok = True
2460
2461
2462def test_evaluate_errors(case_setup):

Callers

nothing calls this directly

Calls 11

test_fileMethod · 0.80
write_add_breakpointMethod · 0.80
wait_for_messageMethod · 0.80
write_run_threadMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected