MCPcopy Index your code
hub / github.com/python/cpython / test_resource_warning

Method test_resource_warning

Lib/test/_test_multiprocessing.py:3275–3289  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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
3291def raising():
3292 raise KeyError("key")

Callers

nothing calls this directly

Calls 4

terminateMethod · 0.95
joinMethod · 0.95
skipTestMethod · 0.80
PoolMethod · 0.45

Tested by

no test coverage detected