[Python-checkins] cpython (2.7): Fix sporadic failure in test_startfile.
nadeem.vawda
python-checkins at python.org
Tue Apr 19 02:29:16 CEST 2011
http://hg.python.org/cpython/rev/84272228d7db
changeset: 69432:84272228d7db
branch: 2.7
parent: 69427:ebd080593351
user: Nadeem Vawda <nadeem.vawda at gmail.com>
date: Tue Apr 19 01:35:58 2011 +0200
summary:
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.
files:
Lib/test/test_startfile.py | 6 ++++++
Misc/NEWS | 2 ++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/Lib/test/test_startfile.py b/Lib/test/test_startfile.py
--- a/Lib/test/test_startfile.py
+++ b/Lib/test/test_startfile.py
@@ -11,6 +11,7 @@
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 @@
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)
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -367,6 +367,8 @@
Tests
-----
+- Fix test_startfile to wait for child process to terminate before finishing.
+
- Issue #11719: Fix message about unexpected test_msilib skip on non-Windows
platforms. Patch by Nadeem Vawda.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list