MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_stderr_fileobj

Method test_stderr_fileobj

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

Source from the content-addressed store, hash-verified

617 self.assertEqual(os.read(d, 1024), b"strawberry")
618
619 def test_stderr_fileobj(self):
620 # stderr is set to open file object
621 tf = tempfile.TemporaryFile()
622 self.addCleanup(tf.close)
623 p = subprocess.Popen([sys.executable, "-c",
624 'import sys; sys.stderr.write("strawberry")'],
625 stderr=tf)
626 p.wait()
627 tf.seek(0)
628 self.assertEqual(tf.read(), b"strawberry")
629
630 def test_stderr_redirect_with_no_stdout_redirect(self):
631 # test stderr=STDOUT while stdout=None (not set)

Callers

nothing calls this directly

Calls 5

waitMethod · 0.95
addCleanupMethod · 0.80
seekMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected