(hit, exc_type, exc_desc)
| 1593 | writer.write_make_initial_run() |
| 1594 | |
| 1595 | def check(hit, exc_type, exc_desc): |
| 1596 | writer.write_get_current_exception(hit.thread_id) |
| 1597 | msg = writer.wait_for_message( |
| 1598 | accept_message=lambda msg: exc_type in msg and 'exc_type="' in msg and 'exc_desc="' in msg, unquote_msg=False |
| 1599 | ) |
| 1600 | assert unquote(msg.thread["exc_desc"]) == exc_desc |
| 1601 | assert unquote(msg.thread["exc_type"]) in ( |
| 1602 | "<type 'exceptions.%s'>" % (exc_type,), # py2 |
| 1603 | "<class '%s'>" % (exc_type,), # py3 |
| 1604 | ) |
| 1605 | if len(msg.thread.frame) == 0: |
| 1606 | assert unquote(unquote(msg.thread.frame["file"])).endswith("_debugger_case_unhandled_exceptions.py") |
| 1607 | else: |
| 1608 | assert unquote(unquote(msg.thread.frame[0]["file"])).endswith("_debugger_case_unhandled_exceptions.py") |
| 1609 | writer.write_run_thread(hit.thread_id) |
| 1610 | |
| 1611 | # Will stop in 2 background threads |
| 1612 | hit0 = writer.wait_for_breakpoint_hit(REASON_UNCAUGHT_EXCEPTION) |
no test coverage detected