summaryrefslogtreecommitdiff
path: root/Lib/test/test_startfile.py
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2011-04-19 01:35:58 +0200
committerNadeem Vawda <nadeem.vawda@gmail.com>2011-04-19 01:35:58 +0200
commit4b197a94e8ac976a6f694da353607c54ea476d7d (patch)
tree10657ac1e9295518c4be0dc12a5245b996b971d0 /Lib/test/test_startfile.py
parent844d201c25c3a18e5e2d14346c0c78b182acfa68 (diff)
downloadcpython-4b197a94e8ac976a6f694da353607c54ea476d7d.tar.gz
Fix sporadic failure in test_startfile.
Wait for the child process to terminate before ending the test, so that the regrtest cleanup code doesn't get an error when it tries to delete the temporary CWD.
Diffstat (limited to 'Lib/test/test_startfile.py')
-rw-r--r--Lib/test/test_startfile.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_startfile.py b/Lib/test/test_startfile.py
index 8eeae72eab..9dce8fd6ac 100644
--- a/Lib/test/test_startfile.py
+++ b/Lib/test/test_startfile.py
@@ -11,6 +11,7 @@ import unittest
from test import test_support
import os
from os import path
+from time import sleep
startfile = test_support.get_attribute(os, 'startfile')
@@ -26,11 +27,16 @@ class TestCase(unittest.TestCase):
empty = path.join(path.dirname(__file__), "empty.vbs")
startfile(empty)
startfile(empty, "open")
+ # Give the child process some time to exit before we finish.
+ # Otherwise the cleanup code will not be able to delete the cwd,
+ # because it is still in use.
+ sleep(0.1)
def test_empty_u(self):
empty = path.join(path.dirname(__file__), "empty.vbs")
startfile(unicode(empty, "mbcs"))
startfile(unicode(empty, "mbcs"), "open")
+ sleep(0.1)
def test_main():
test_support.run_unittest(TestCase)