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

Function test_gui_event_loop_qt5

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

Source from the content-addressed store, hash-verified

5854
5855
5856def test_gui_event_loop_qt5(case_setup_dap):
5857 try:
5858 from PySide2 import QtCore
5859 except ImportError:
5860 pytest.skip("PySide2 not available")
5861
5862 with case_setup_dap.test_file("_debugger_case_gui_event_loop_qt5.py") as writer:
5863 json_facade = JsonFacade(writer)
5864 json_facade.write_launch(guiEventLoop="qt5", redirectOutput=True)
5865 break_line = writer.get_line_index_with_content("break here")
5866 json_facade.write_set_breakpoints(break_line)
5867
5868 json_facade.write_make_initial_run()
5869 json_facade.wait_for_thread_stopped()
5870
5871 # i.e.: if we don't have the event loop running in this test, this
5872 # output is not shown (as the QTimer timeout wouldn't be executed).
5873 for _i in range(3):
5874 json_facade.wait_for_json_message(
5875 OutputEvent, lambda msg: msg.body.category == "stdout" and "on_timeout() called" in msg.body.output
5876 )
5877
5878 json_facade.write_continue()
5879 json_facade.wait_for_terminated()
5880 writer.finished_ok = True
5881
5882
5883@pytest.mark.parametrize("debug_stdlib", [True, False])

Callers

nothing calls this directly

Calls 10

write_launchMethod · 0.95
write_set_breakpointsMethod · 0.95
wait_for_json_messageMethod · 0.95
write_continueMethod · 0.95
wait_for_terminatedMethod · 0.95
JsonFacadeClass · 0.85
test_fileMethod · 0.80

Tested by

no test coverage detected