diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-03-15 08:13:49 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-03-15 08:13:49 -0400 |
commit | bb847f0a824febec391ebb8e4f64f859e38459c0 (patch) | |
tree | 5016b8454974754495e3c7be8c504e4f856a4d9b | |
parent | ef458b14849712f1c2e6036d1837c17e4d94055f (diff) | |
download | python-coveragepy-git-bb847f0a824febec391ebb8e4f64f859e38459c0.tar.gz |
Removing a directory shouldn't panic if the directory doesn't exist.
-rw-r--r-- | test/test_farm.py | 6 |
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. |