MCPcopy Create free account
hub / github.com/microsoft/debugpy / wait_for_stop

Method wait_for_stop

tests/debug/session.py:917–957  ·  view source on GitHub ↗
(
        self,
        reason=some.str,
        expected_frames=None,
        expected_text=None,
        expected_description=None,
    )

Source from the content-addressed store, hash-verified

915 )
916
917 def wait_for_stop(
918 self,
919 reason=some.str,
920 expected_frames=None,
921 expected_text=None,
922 expected_description=None,
923 ):
924 stopped = self.wait_for_next_event("stopped")
925
926 expected_stopped = {
927 "reason": reason,
928 "threadId": some.int,
929 "allThreadsStopped": True,
930 }
931 if expected_text is not None:
932 expected_stopped["text"] = expected_text
933 if expected_description is not None:
934 expected_stopped["description"] = expected_description
935 if stopped("reason", str) not in [
936 "step",
937 "exception",
938 "breakpoint",
939 "entry",
940 "goto",
941 ]:
942 expected_stopped["preserveFocusHint"] = True
943 assert stopped == some.dict.containing(expected_stopped)
944
945 tid = stopped("threadId", int)
946 stack_trace = self.request("stackTrace", {"threadId": tid})
947 frames = stack_trace("stackFrames", json.array()) or []
948 assert len(frames) == stack_trace("totalFrames", int)
949
950 if expected_frames:
951 assert len(expected_frames) <= len(frames)
952 assert expected_frames == frames[0 : len(expected_frames)]
953
954 assert len(frames) > 0
955
956 fid = frames[0]("id", int)
957 return StopInfo(stopped, frames, tid, fid)
958
959 def wait_for_next_subprocess(self):
960 message = self.timeline.wait_for_next(

Callers 15

test_attach_pid_clientFunction · 0.95
test_with_no_outputFunction · 0.80
test_with_tab_in_outputFunction · 0.80
test_redirect_outputFunction · 0.80
test_non_ascii_outputFunction · 0.80
test_pythonw_outputFunction · 0.80
test_with_path_mappingsFunction · 0.80
test_stack_formatFunction · 0.80

Calls 2

wait_for_next_eventMethod · 0.95
requestMethod · 0.95

Tested by 15

test_attach_pid_clientFunction · 0.76
test_with_no_outputFunction · 0.64
test_with_tab_in_outputFunction · 0.64
test_redirect_outputFunction · 0.64
test_non_ascii_outputFunction · 0.64
test_pythonw_outputFunction · 0.64
test_with_path_mappingsFunction · 0.64
test_stack_formatFunction · 0.64