mirror of
https://github.com/python/cpython.git
synced 2025-09-04 07:51:13 +00:00
Add test to explicit check the absence regression in subprocess (issue #15592).
Patch by Chris Jerdonek.
This commit is contained in:
parent
f158d86074
commit
f3765071eb
1 changed files with 12 additions and 0 deletions
|
@ -548,6 +548,18 @@ class ProcessTestCase(BaseTestCase):
|
||||||
(stdout, stderr) = p.communicate("line1\nline3\n")
|
(stdout, stderr) = p.communicate("line1\nline3\n")
|
||||||
self.assertEqual(p.returncode, 0)
|
self.assertEqual(p.returncode, 0)
|
||||||
|
|
||||||
|
def test_universal_newlines_communicate_input_none(self):
|
||||||
|
# Test communicate(input=None) with universal newlines.
|
||||||
|
#
|
||||||
|
# We set stdout to PIPE because, as of this writing, a different
|
||||||
|
# code path is tested when the number of pipes is zero or one.
|
||||||
|
p = subprocess.Popen([sys.executable, "-c", "pass"],
|
||||||
|
stdin=subprocess.PIPE,
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
universal_newlines=True)
|
||||||
|
p.communicate()
|
||||||
|
self.assertEqual(p.returncode, 0)
|
||||||
|
|
||||||
def test_no_leaking(self):
|
def test_no_leaking(self):
|
||||||
# Make sure we leak no resources
|
# Make sure we leak no resources
|
||||||
if not mswindows:
|
if not mswindows:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue