summaryrefslogtreecommitdiff
path: root/Lib/test/test_startfile.py
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2011-04-19 01:38:47 +0200
committerNadeem Vawda <nadeem.vawda@gmail.com>2011-04-19 01:38:47 +0200
commit58de6ee8711a079da0b555221ae739d6a69df2f7 (patch)
treed5301552b785e796a0f59c6a09490997b737466e /Lib/test/test_startfile.py
parent6c9b35bfe2585af08ea6480294e096e2d2397fe3 (diff)
downloadcpython-git-58de6ee8711a079da0b555221ae739d6a69df2f7.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.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_startfile.py b/Lib/test/test_startfile.py
index 7a003eb54b..dd505bf8ce 100644
--- a/Lib/test/test_startfile.py
+++ b/Lib/test/test_startfile.py
@@ -11,6 +11,7 @@ import unittest
from test import support
import os
from os import path
+from time import sleep
startfile = support.get_attribute(os, 'startfile')
@@ -23,6 +24,10 @@ 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_main():
support.run_unittest(TestCase)