MCPcopy Create free account
hub / github.com/python/cpython / test_noforkbomb

Method test_noforkbomb

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

Source from the content-addressed store, hash-verified

5826
5827class TestNoForkBomb(unittest.TestCase):
5828 def test_noforkbomb(self):
5829 sm = multiprocessing.get_start_method()
5830 name = os.path.join(os.path.dirname(__file__), 'mp_fork_bomb.py')
5831 if sm != 'fork':
5832 rc, out, err = test.support.script_helper.assert_python_failure(name, sm)
5833 self.assertEqual(out, b'')
5834 self.assertIn(b'RuntimeError', err)
5835 else:
5836 rc, out, err = test.support.script_helper.assert_python_ok(name, sm)
5837 self.assertEqual(out.rstrip(), b'123')
5838 self.assertEqual(err, b'')
5839
5840#
5841# Issue #17555: ForkAwareThreadLock

Callers

nothing calls this directly

Calls 8

assert_python_failureMethod · 0.80
assertInMethod · 0.80
assert_python_okMethod · 0.80
get_start_methodMethod · 0.45
joinMethod · 0.45
dirnameMethod · 0.45
assertEqualMethod · 0.45
rstripMethod · 0.45

Tested by

no test coverage detected