Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions Lib/test/test_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -3719,8 +3719,9 @@ def test_startupinfo(self):
# Since Python is a console process, it won't be affected
# by wShowWindow, but the argument should be silently
# ignored
subprocess.call(ZERO_RETURN_CMD,
startupinfo=startupinfo)
rc = subprocess.call(ZERO_RETURN_CMD,
startupinfo=startupinfo)
self.assertEqual(rc, 0)

def test_startupinfo_keywords(self):
# startupinfo argument
Expand All @@ -3735,8 +3736,9 @@ def test_startupinfo_keywords(self):
# Since Python is a console process, it won't be affected
# by wShowWindow, but the argument should be silently
# ignored
subprocess.call(ZERO_RETURN_CMD,
startupinfo=startupinfo)
rc = subprocess.call(ZERO_RETURN_CMD,
startupinfo=startupinfo)
self.assertEqual(rc, 0)

def test_startupinfo_copy(self):
# bpo-34044: Popen must not modify input STARTUPINFO structure
Expand Down Expand Up @@ -3853,14 +3855,16 @@ def test_close_fds_with_stdio(self):
def test_empty_attribute_list(self):
startupinfo = subprocess.STARTUPINFO()
startupinfo.lpAttributeList = {}
subprocess.call(ZERO_RETURN_CMD,
startupinfo=startupinfo)
rc = subprocess.call(ZERO_RETURN_CMD,
startupinfo=startupinfo)
self.assertEqual(rc, 0)

def test_empty_handle_list(self):
startupinfo = subprocess.STARTUPINFO()
startupinfo.lpAttributeList = {"handle_list": []}
subprocess.call(ZERO_RETURN_CMD,
startupinfo=startupinfo)
rc = subprocess.call(ZERO_RETURN_CMD,
startupinfo=startupinfo)
self.assertEqual(rc, 0)

def test_shell_sequence(self):
# Run command through the shell (sequence)
Expand All @@ -3871,6 +3875,8 @@ def test_shell_sequence(self):
env=newenv)
with p:
self.assertIn(b"physalis", p.stdout.read())
p.communicate()
self.assertEqual(p.returncode, 0)

def test_shell_string(self):
# Run command through the shell (string)
Expand All @@ -3881,6 +3887,8 @@ def test_shell_string(self):
env=newenv)
with p:
self.assertIn(b"physalis", p.stdout.read())
p.communicate()
self.assertEqual(p.returncode, 0)

def test_shell_encodings(self):
# Run command through the shell (string)
Expand All @@ -3893,6 +3901,8 @@ def test_shell_encodings(self):
encoding=enc)
with p:
self.assertIn("physalis", p.stdout.read(), enc)
p.communicate()
self.assertEqual(p.returncode, 0)

def test_call_string(self):
# call() function with string argument on Windows
Expand Down
Loading