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

Method test_check_output_nonzero

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

Source from the content-addressed store, hash-verified

203 subprocess.check_output([], check=False)
204
205 def test_check_output_nonzero(self):
206 # check_call() function with non-zero return code
207 with self.assertRaises(subprocess.CalledProcessError) as c:
208 subprocess.check_output(
209 [sys.executable, "-c", "import sys; sys.exit(5)"])
210 self.assertEqual(c.exception.returncode, 5)
211
212 def test_check_output_stderr(self):
213 # check_output() function stderr redirected to stdout

Callers

nothing calls this directly

Calls 3

assertRaisesMethod · 0.45
check_outputMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected