summaryrefslogtreecommitdiff
path: root/test/test_farm.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2010-03-21 16:57:21 -0400
committerNed Batchelder <ned@nedbatchelder.com>2010-03-21 16:57:21 -0400
commit3c41aafc6cf5f16cfd56db12bb3d89463827d81a (patch)
treebf07d4bf19da136790923e57d1dc0bd0ce78336b /test/test_farm.py
parent88f696023c9faa5105e30dc76596a2c141127a94 (diff)
downloadpython-coveragepy-3c41aafc6cf5f16cfd56db12bb3d89463827d81a.tar.gz
Yet more chainsaw action to try to prevent spurious test failures on Windows 7
Diffstat (limited to 'test/test_farm.py')
-rw-r--r--test/test_farm.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/test_farm.py b/test/test_farm.py
index 08e51cd..79b345a 100644
--- a/test/test_farm.py
+++ b/test/test_farm.py
@@ -294,10 +294,12 @@ class FarmTestCase(object):
def clean(self, cleandir):
"""Clean `cleandir` by removing it and all its children completely."""
- if os.path.exists(cleandir):
- # rmtree gives mysterious failures on Win7, so retry a few times.
- tries = 3
- while tries:
+ # rmtree gives mysterious failures on Win7, so retry a "few" times.
+ # I've seen it take over 100 tries, so, 1000! This is probably the
+ # most unpleasant hack I've written in a long time...
+ tries = 1000
+ while tries:
+ if os.path.exists(cleandir):
try:
shutil.rmtree(cleandir)
except OSError:
@@ -306,7 +308,7 @@ class FarmTestCase(object):
else:
tries -= 1
continue
- break
+ break
def main(): # pragma: no cover