summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-03-15 08:13:49 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-03-15 08:13:49 -0400
commitbb847f0a824febec391ebb8e4f64f859e38459c0 (patch)
tree5016b8454974754495e3c7be8c504e4f856a4d9b
parentef458b14849712f1c2e6036d1837c17e4d94055f (diff)
downloadpython-coveragepy-git-bb847f0a824febec391ebb8e4f64f859e38459c0.tar.gz
Removing a directory shouldn't panic if the directory doesn't exist.
-rw-r--r--test/test_farm.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/test_farm.py b/test/test_farm.py
index 12d90775..bc9528a8 100644
--- a/test/test_farm.py
+++ b/test/test_farm.py
@@ -50,7 +50,8 @@ class FarmTestCase(object):
def copy(self, src, dst):
"""Copy a directory."""
- shutil.rmtree(dst, ignore_errors=True)
+ if os.path.exists(dst):
+ shutil.rmtree(dst)
shutil.copytree(src, dst)
def run(self, cmds, rundir="src"):
@@ -77,7 +78,8 @@ class FarmTestCase(object):
assert not right_only, "Files in %s only: %s" % (dir2, right_only)
def clean(self, cleandir):
- shutil.rmtree(cleandir)
+ if os.path.exists(cleandir):
+ shutil.rmtree(cleandir)
# So that we can run just one farm run.py at a time.