mirror of https://github.com/python/cpython.git
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.
This commit is contained in:
parent
059061a237
commit
bafc6a9fca
|
@ -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 @@ def test_empty(self):
|
|||
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)
|
||||
|
|
Loading…
Reference in New Issue