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

Function test_flask_breakpoint_multiproc

tests/debugpy/test_flask.py:216–252  ·  view source on GitHub ↗
(start_flask)

Source from the content-addressed store, hash-verified

214
215
216def test_flask_breakpoint_multiproc(start_flask):
217 bp_line = lines.app_py["bphome"]
218 bp_var_content = "Flask-Jinja-Test"
219
220 with debug.Session() as parent_session:
221 with start_flask(parent_session, multiprocess=True):
222 parent_session.set_breakpoints(paths.app_py, [bp_line])
223
224 with parent_session.wait_for_next_subprocess() as child_session:
225 with child_session.start():
226 child_session.set_breakpoints(paths.app_py, [bp_line])
227
228 with flask_server:
229 home_request = flask_server.get("/")
230 child_session.wait_for_stop(
231 "breakpoint",
232 expected_frames=[
233 some.dap.frame(
234 some.dap.source(paths.app_py), line=bp_line, name="home"
235 )
236 ],
237 )
238
239 var_content = child_session.get_variable("content")
240 assert var_content == some.dict.containing(
241 {
242 "name": "content",
243 "type": "str",
244 "value": repr(bp_var_content),
245 "presentationHint": {"attributes": ["rawString"]},
246 "evaluateName": "content",
247 "variablesReference": 0,
248 }
249 )
250
251 child_session.request_continue()
252 assert bp_var_content in home_request.response_text()

Callers

nothing calls this directly

Calls 11

start_flaskFunction · 0.85
reprFunction · 0.85
set_breakpointsMethod · 0.80
wait_for_stopMethod · 0.80
request_continueMethod · 0.80
response_textMethod · 0.80
startMethod · 0.45
getMethod · 0.45
sourceMethod · 0.45
get_variableMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…