8000 Add test · python/cpython@040e6f9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 040e6f9

Browse files
committed
Add test
1 parent 4127748 commit 040e6f9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Lib/test/test_venv.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,23 @@ def test_venv_same_path(self):
872872
else:
873873
self.assertFalse(same_path(path1, path2))
874874

875+
# gh-126084: venvwlauncher should run pythonw, not python
876+
@requireVenvCreate
877+
@unittest.skipUnless(os.name == 'nt', 'only relevant on Windows')
878+
def test_venvwlauncher(self):
879+
"""
880+
Test that the GUI launcher runs the GUI python.
881+
"""
882+
rmtree(self.env_dir)
883+
venv.create(self.env_dir)
884+
pythonw = os.path.join(self.env_dir, self.bindir, "pythonw.exe")
885+
try:
886+
subprocess.check_call([pythonw, "-c", "import _winapi; "
887+
"assert _winapi.GetModuleFileName(0).endswith('pythonw.exe')"])
888+
except subprocess.CalledProcessError:
889+
self.fail("venvwlauncher.exe did not run pythonw.exe")
890+
891+
875892
@requireVenvCreate
876893
class EnsurePipTest(BaseTest):
877894
"""Test venv module installation of pip."""

0 commit comments

Comments
 (0)
0