changeset 58:3d413c54e048

tests: be prepared for basetest.setUp not being called tests might choose to do something else
author Idan Kamara <idankk86@gmail.com>
date Fri, 19 Aug 2011 20:08:13 +0300
parents 2657fd6fef04
children f4cc7ff53cf8
files tests/common.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/common.py	Fri Aug 19 20:08:13 2011 +0300
+++ b/tests/common.py	Fri Aug 19 20:08:13 2011 +0300
@@ -15,7 +15,10 @@
         self.client = hglib.open()
 
     def tearDown(self):
-        shutil.rmtree(self._testtmp)
+        try:
+            shutil.rmtree(self._testtmp)
+        except AttributeError:
+            pass # if our setUp was overriden
 
     def append(self, path, *args):
         f = open(path, 'a')