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

Method test_check_output

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

Source from the content-addressed store, hash-verified

189 self.assertEqual(c.exception.returncode, 47)
190
191 def test_check_output(self):
192 # check_output() function with zero return code
193 output = subprocess.check_output(
194 [sys.executable, "-c", "print('BDFL')"])
195 self.assertIn(b'BDFL', output)
196
197 with self.assertRaisesRegex(ValueError,
198 "stdout argument not allowed, it will be overridden"):
199 subprocess.check_output([], stdout=None)
200
201 with self.assertRaisesRegex(ValueError,
202 "check argument not allowed, it will be overridden"):
203 subprocess.check_output([], check=False)
204
205 def test_check_output_nonzero(self):
206 # check_call() function with non-zero return code

Callers

nothing calls this directly

Calls 3

assertInMethod · 0.80
assertRaisesRegexMethod · 0.80
check_outputMethod · 0.45

Tested by

no test coverage detected