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:1835–1844  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1833 self.assertIn(b'BDFL', cp.stderr)
1834
1835 def test_check_output_stdin_arg(self):
1836 # run() can be called with stdin set to a file
1837 tf = tempfile.TemporaryFile()
1838 self.addCleanup(tf.close)
1839 tf.write(b'pear')
1840 tf.seek(0)
1841 cp = self.run_python(
1842 "import sys; sys.stdout.write(sys.stdin.read().upper())",
1843 stdin=tf, stdout=subprocess.PIPE)
1844 self.assertIn(b'PEAR', cp.stdout)
1845
1846 def test_check_output_input_arg(self):
1847 # check_output() can be called with input set to a string

Callers

nothing calls this directly

Calls 5

run_pythonMethod · 0.95
addCleanupMethod · 0.80
assertInMethod · 0.80
writeMethod · 0.45
seekMethod · 0.45

Tested by

no test coverage detected