diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2010-03-21 16:57:21 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2010-03-21 16:57:21 -0400 |
commit | 0b4456981ec6c0b5f131406a6e813361bb58c717 (patch) | |
tree | c69535b11e85d138dc707b7e21501482fc5a3529 /test/test_farm.py | |
parent | cc9534ba3869c671010f91c02e884c4da328b5ea (diff) | |
download | python-coveragepy-git-0b4456981ec6c0b5f131406a6e813361bb58c717.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.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/test_farm.py b/test/test_farm.py index 08e51cd6..79b345a6 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 |