fix bugs in coverage.py.
authorVadim Gelfer <vadim.gelfer@gmail.com>
Thu, 13 Apr 2006 17:06:57 -0700
changeset 2067 3094becfd8e8
parent 2066 a5d072f38a4a
child 2068 4a49daa3a40c
fix bugs in coverage.py.
tests/coverage.py
--- a/tests/coverage.py	Thu Apr 13 15:10:03 2006 -0700
+++ b/tests/coverage.py	Thu Apr 13 17:06:57 2006 -0700
@@ -348,12 +348,8 @@
             args = self.cexecuted.keys()
         ignore_errors = settings.get('ignore-errors')
         show_missing = settings.get('show-missing')
-        directory = settings.get('directory=')
-        omit = settings.get('omit=')
-        if omit is not None:
-            omit = omit.split(',')
-        else:
-            omit = []
+        directory = settings.get('directory')
+        omit = filter(None, settings.get('omit', '').split(','))
 
         if settings.get('report'):
             self.report(args, show_missing, ignore_errors, omit_prefixes=omit)
@@ -365,7 +361,8 @@
         
     def get_ready(self):
         if self.usecache and not self.cache:
-            self.cache = os.environ.get(self.cache_env, self.cache_default)
+            self.cache = os.path.abspath(os.environ.get(self.cache_env,
+                                                        self.cache_default))
             self.restore()
         self.analysis_cache = {}
         
@@ -408,6 +405,8 @@
     # save().  Save coverage data to the coverage cache.
 
     def save(self):
+        # move to directory that must exist.
+        os.chdir(os.sep)
         if self.usecache and self.cache:
             self.canonicalize_filenames()
             cache = open(self.cache, 'wb')