(start_flask, exc_type)
| 165 | |
| 166 | @pytest.mark.parametrize("exc_type", ["handled", "unhandled"]) |
| 167 | def 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 | |
| 216 | def test_flask_breakpoint_multiproc(start_flask): |
nothing calls this directly
no test coverage detected
searching dependent graphs…