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

Method test_stdin_none

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

Source from the content-addressed store, hash-verified

316 self.assertEqual(s.getvalue(), '')
317
318 def test_stdin_none(self):
319 # .stdin is None when not redirected
320 p = subprocess.Popen([sys.executable, "-c", 'print("banana")'],
321 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
322 self.addCleanup(p.stdout.close)
323 self.addCleanup(p.stderr.close)
324 p.wait()
325 self.assertEqual(p.stdin, None)
326
327 def test_stdout_none(self):
328 # .stdout is None when not redirected, and the child's stdout will

Callers

nothing calls this directly

Calls 3

waitMethod · 0.95
addCleanupMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected