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

Method test_timeout_exception

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

Source from the content-addressed store, hash-verified

163 timeout=0.1)
164
165 def test_timeout_exception(self):
166 try:
167 subprocess.run([sys.executable, '-c', 'import time;time.sleep(9)'], timeout = -1)
168 except subprocess.TimeoutExpired as e:
169 self.assertIn("-1 seconds", str(e))
170 else:
171 self.fail("Expected TimeoutExpired exception not raised")
172 try:
173 subprocess.run([sys.executable, '-c', 'import time;time.sleep(9)'], timeout = 0)
174 except subprocess.TimeoutExpired as e:
175 self.assertIn("0 seconds", str(e))
176 else:
177 self.fail("Expected TimeoutExpired exception not raised")
178
179 def test_check_call_zero(self):
180 # check_call() function with zero return code

Callers

nothing calls this directly

Calls 4

strFunction · 0.85
assertInMethod · 0.80
runMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected