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

Function test_flask_exception_no_multiproc

tests/debugpy/test_flask.py:167–213  ·  view source on GitHub ↗
(start_flask, exc_type)

Source from the content-addressed store, hash-verified

165
166@pytest.mark.parametrize("exc_type", ["handled", "unhandled"])
167def test_flask_exception_no_multiproc(start_flask, exc_type):
168 exc_line = lines.app_py["exc_" + exc_type]
169
170 with debug.Session() as session:
171 with start_flask(session):
172 session.request(
173 "setExceptionBreakpoints", {"filters": ["raised", "uncaught"]}
174 )
175
176 with flask_server:
177 flask_server.get("/" + exc_type)
178 stopped = session.wait_for_stop(
179 "exception",
180 expected_frames=[
181 some.dap.frame(
182 some.dap.source(paths.app_py),
183 line=exc_line,
184 name="bad_route_" + exc_type,
185 )
186 ],
187 ).body
188
189 assert stopped == some.dict.containing(
190 {
191 "reason": "exception",
192 "text": some.str.ending_with("ArithmeticError"),
193 "description": "Hello",
194 }
195 )
196
197 exception_info = session.request(
198 "exceptionInfo", {"threadId": stopped["threadId"]}
199 )
200
201 assert exception_info == {
202 "exceptionId": some.str.ending_with("ArithmeticError"),
203 "breakMode": "always",
204 "description": "Hello",
205 "details": {
206 "message": "Hello",
207 "typeName": some.str.ending_with("ArithmeticError"),
208 "source": some.path(paths.app_py),
209 "stackTrace": some.str,
210 },
211 }
212
213 session.request_continue()
214
215
216def test_flask_breakpoint_multiproc(start_flask):

Callers

nothing calls this directly

Calls 7

start_flaskFunction · 0.85
wait_for_stopMethod · 0.80
pathMethod · 0.80
request_continueMethod · 0.80
requestMethod · 0.45
getMethod · 0.45
sourceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…