(self)
| 151 | self.assertEqual(thread._count(), orig) |
| 152 | |
| 153 | def test_unraisable_exception(self): |
| 154 | def task(): |
| 155 | started.release() |
| 156 | raise ValueError("task failed") |
| 157 | |
| 158 | started = thread.allocate_lock() |
| 159 | with support.catch_unraisable_exception() as cm: |
| 160 | with threading_helper.wait_threads_exit(): |
| 161 | started.acquire() |
| 162 | thread.start_new_thread(task, ()) |
| 163 | started.acquire() |
| 164 | |
| 165 | self.assertEqual(str(cm.unraisable.exc_value), "task failed") |
| 166 | self.assertIsNone(cm.unraisable.object) |
| 167 | self.assertEqual(cm.unraisable.err_msg, |
| 168 | f"Exception ignored in thread started by {task!r}") |
| 169 | self.assertIsNotNone(cm.unraisable.exc_traceback) |
| 170 | |
| 171 | def test_join_thread(self): |
| 172 | finished = [] |
nothing calls this directly
no test coverage detected