diff options
author | Subhendu Ghosh <subho.prp@gmail.com> | 2017-02-25 14:59:05 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2017-02-25 14:59:05 (GMT) |
commit | ae160bba2030a7b6c86f6c7aeaf2f9d3fdb627b7 (patch) | |
tree | 82df8ee0582f8a14dba8154fdd18b5383ac21f62 /Lib/test/test_subprocess.py | |
parent | 21024f06622c4c55b666adb130797a4ee205d005 (diff) | |
download | cpython-ae160bba2030a7b6c86f6c7aeaf2f9d3fdb627b7.zip cpython-ae160bba2030a7b6c86f6c7aeaf2f9d3fdb627b7.tar.gz cpython-ae160bba2030a7b6c86f6c7aeaf2f9d3fdb627b7.tar.bz2 |
bpo-26128: Added __init__to subprocess.STARTUPINFO (#171)
The Windows-specific subprocess.STARTUPINFO class now accepts
keyword-only arguments to its constructor to set the various
data attributes.
Patch by Subhendu Ghosh.
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r-- | Lib/test/test_subprocess.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 82e0b87..812e7bf 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -2550,6 +2550,22 @@ class Win32ProcessTestCase(BaseTestCase): subprocess.call([sys.executable, "-c", "import sys; sys.exit(0)"], startupinfo=startupinfo) + def test_startupinfo_keywords(self): + # startupinfo argument + # We use hardcoded constants, because we do not want to + # depend on win32all. + STARTF_USERSHOWWINDOW = 1 + SW_MAXIMIZE = 3 + startupinfo = subprocess.STARTUPINFO( + dwFlags=STARTF_USERSHOWWINDOW, + wShowWindow=SW_MAXIMIZE + ) + # Since Python is a console process, it won't be affected + # by wShowWindow, but the argument should be silently + # ignored + subprocess.call([sys.executable, "-c", "import sys; sys.exit(0)"], + startupinfo=startupinfo) + def test_creationflags(self): # creationflags argument CREATE_NEW_CONSOLE = 16 |