(start_django, exc_type)
| 135 | |
| 136 | @pytest.mark.parametrize("exc_type", ["handled", "unhandled"]) |
| 137 | def test_django_exception_no_multiproc(start_django, exc_type): |
| 138 | exc_line = lines.app_py["exc_" + exc_type] |
| 139 | |
| 140 | with debug.Session() as session: |
| 141 | with start_django(session): |
| 142 | session.request( |
| 143 | "setExceptionBreakpoints", {"filters": ["raised", "uncaught"]} |
| 144 | ) |
| 145 | |
| 146 | with django_server: |
| 147 | django_server.get("/" + exc_type) |
| 148 | |
| 149 | stopped = session.wait_for_stop( |
| 150 | "exception", |
| 151 | expected_frames=[ |
| 152 | some.dap.frame( |
| 153 | some.dap.source(paths.app_py), |
| 154 | line=exc_line, |
| 155 | name="bad_route_" + exc_type, |
| 156 | ) |
| 157 | ], |
| 158 | ).body |
| 159 | |
| 160 | assert stopped == some.dict.containing( |
| 161 | { |
| 162 | "reason": "exception", |
| 163 | "text": some.str.ending_with("ArithmeticError"), |
| 164 | "description": "Hello", |
| 165 | } |
| 166 | ) |
| 167 | |
| 168 | exception_info = session.request( |
| 169 | "exceptionInfo", {"threadId": stopped["threadId"]} |
| 170 | ) |
| 171 | |
| 172 | assert exception_info == { |
| 173 | "exceptionId": some.str.ending_with("ArithmeticError"), |
| 174 | "breakMode": "always", |
| 175 | "description": "Hello", |
| 176 | "details": { |
| 177 | "message": "Hello", |
| 178 | "typeName": some.str.ending_with("ArithmeticError"), |
| 179 | "source": some.path(paths.app_py), |
| 180 | "stackTrace": some.str, |
| 181 | }, |
| 182 | } |
| 183 | |
| 184 | session.request_continue() |
| 185 | |
| 186 | |
| 187 | def test_django_breakpoint_multiproc(start_django): |
nothing calls this directly
no test coverage detected
searching dependent graphs…