(self)
| 136 | self.assertEqual(thread._count(), orig) |
| 137 | |
| 138 | def test_unraisable_exception(self): |
| 139 | def task(): |
| 140 | started.release() |
| 141 | raise ValueError("task failed") |
| 142 | |
| 143 | started = thread.allocate_lock() |
| 144 | with support.catch_unraisable_exception() as cm: |
| 145 | with threading_helper.wait_threads_exit(): |
| 146 | started.acquire() |
| 147 | thread.start_new_thread(task, ()) |
| 148 | started.acquire() |
| 149 | |
| 150 | self.assertEqual(str(cm.unraisable.exc_value), "task failed") |
| 151 | self.assertIs(cm.unraisable.object, task) |
| 152 | self.assertEqual(cm.unraisable.err_msg, |
| 153 | "Exception ignored in thread started by") |
| 154 | self.assertIsNotNone(cm.unraisable.exc_traceback) |
| 155 | |
| 156 | |
| 157 | class Barrier: |
nothing calls this directly
no test coverage detected