FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-150436: Check returncode in Win32ProcessTestCase by vstinner · Pull Request #150972 · python/cpython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
26 changes: 18 additions & 8 deletions Lib/test/test_subprocess.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL