diff options
author | Steve Dower <steve.dower@python.org> | 2021-04-23 17:03:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-23 17:03:17 (GMT) |
commit | 019e9e816882f5c43c4b833f81844b8299e815fd (patch) | |
tree | adb876fd609653dbaa6f9dfb76c9da68190957a2 /Lib/test/test_startfile.py | |
parent | 3513d55a617012002c3f82dbf3cec7ec1abd7090 (diff) | |
download | cpython-019e9e816882f5c43c4b833f81844b8299e815fd.zip cpython-019e9e816882f5c43c4b833f81844b8299e815fd.tar.gz cpython-019e9e816882f5c43c4b833f81844b8299e815fd.tar.bz2 |
bpo-43538: Add extra arguments to os.startfile (GH-25538)
Diffstat (limited to 'Lib/test/test_startfile.py')
-rw-r--r-- | Lib/test/test_startfile.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/test_startfile.py b/Lib/test/test_startfile.py index 589ffa2..8c64299 100644 --- a/Lib/test/test_startfile.py +++ b/Lib/test/test_startfile.py @@ -18,11 +18,11 @@ from os import path startfile = support.get_attribute(os, 'startfile') +@unittest.skipIf(platform.win32_is_iot(), "starting files is not supported on Windows IoT Core or nanoserver") class TestCase(unittest.TestCase): def test_nonexisting(self): self.assertRaises(OSError, startfile, "nonexisting.vbs") - @unittest.skipIf(platform.win32_is_iot(), "starting files is not supported on Windows IoT Core or nanoserver") def test_empty(self): # We need to make sure the child process starts in a directory # we're not about to delete. If we're running under -j, that @@ -32,6 +32,14 @@ class TestCase(unittest.TestCase): empty = path.join(path.dirname(__file__), "empty.vbs") startfile(empty) startfile(empty, "open") + startfile(empty, cwd=path.dirname(sys.executable)) + + def test_python(self): + # Passing "-V" ensures that it closes quickly, though still not + # quickly enough that we can run in the test directory + cwd, name = path.split(sys.executable) + startfile(name, arguments="-V", cwd=cwd) + startfile(name, arguments="-V", cwd=cwd, show_cmd=0) if __name__ == "__main__": unittest.main() |