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

Method test_timeout

Lib/test/test_subprocess.py:1817–1823  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1815 self.assertEqual(cp.returncode, 0)
1816
1817 def test_timeout(self):
1818 # run() function with timeout argument; we want to test that the child
1819 # process gets killed when the timeout expires. If the child isn't
1820 # killed, this call will deadlock since subprocess.run waits for the
1821 # child.
1822 with self.assertRaises(subprocess.TimeoutExpired):
1823 self.run_python("while True: pass", timeout=0.0001)
1824
1825 def test_capture_stdout(self):
1826 # capture stdout with zero return code

Callers

nothing calls this directly

Calls 2

run_pythonMethod · 0.95
assertRaisesMethod · 0.45

Tested by

no test coverage detected