| 3273 | |
| 3274 | @warnings_helper.ignore_fork_in_thread_deprecation_warnings() |
| 3275 | def test_resource_warning(self): |
| 3276 | if self.TYPE == 'manager': |
| 3277 | self.skipTest("test not applicable to manager") |
| 3278 | |
| 3279 | pool = self.Pool(1) |
| 3280 | pool.terminate() |
| 3281 | pool.join() |
| 3282 | |
| 3283 | # force state to RUN to emit ResourceWarning in __del__() |
| 3284 | pool._state = multiprocessing.pool.RUN |
| 3285 | |
| 3286 | with warnings_helper.check_warnings( |
| 3287 | ('unclosed running multiprocessing pool', ResourceWarning)): |
| 3288 | pool = None |
| 3289 | support.gc_collect() |
| 3290 | |
| 3291 | def raising(): |
| 3292 | raise KeyError("key") |