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

Method test_check_output_stdin_arg

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

Source from the content-addressed store, hash-verified

217 self.assertIn(b'BDFL', output)
218
219 def test_check_output_stdin_arg(self):
220 # check_output() can be called with stdin set to a file
221 tf = tempfile.TemporaryFile()
222 self.addCleanup(tf.close)
223 tf.write(b'pear')
224 tf.seek(0)
225 output = subprocess.check_output(
226 [sys.executable, "-c",
227 "import sys; sys.stdout.write(sys.stdin.read().upper())"],
228 stdin=tf)
229 self.assertIn(b'PEAR', output)
230
231 def test_check_output_input_arg(self):
232 # check_output() can be called with input set to a string

Callers

nothing calls this directly

Calls 5

addCleanupMethod · 0.80
assertInMethod · 0.80
writeMethod · 0.45
seekMethod · 0.45
check_outputMethod · 0.45

Tested by

no test coverage detected