[Zodb-checkins] CVS: ZODB4 - test.py:1.5

Barry Warsaw barry@wooz.org
Thu, 5 Dec 2002 12:10:46 -0500


Update of /cvs-repository/ZODB4
In directory cvs.zope.org:/tmp/cvs-serv31581

Modified Files:
	test.py 
Log Message:
Print out how many tests got skipped because dependent modules
couldn't be imported.  Not as pretty as I like, but with 900+ tests,
it's helpful to have a reminder at the end.


=== ZODB4/test.py 1.4 => 1.5 ===
--- ZODB4/test.py:1.4	Thu Dec  5 11:58:07 2002
+++ ZODB4/test.py	Thu Dec  5 12:10:45 2002
@@ -205,6 +205,7 @@
     
     def __init__(self):
         self.files = []
+        self.skips = 0
 
     def check_depends(self, dir):
         # dir is the path of a tests directory
@@ -235,6 +236,7 @@
         if not dir.endswith("tests"):
             return
         if not self.check_depends(dir):
+            self.skips += 1
             return
         # Since we're running from the build directory, every dir
         # should be a file.
@@ -251,7 +253,7 @@
 def find_tests(rx):
     finder = TestFileFinder()
     os.path.walk("build", finder.visit, rx)
-    return finder.files
+    return finder
 
 def package_import(modname):
     mod = __import__(modname)
@@ -343,7 +345,8 @@
 def main(module_filter, test_filter):
     os.path.walk(os.curdir, remove_stale_bytecode, None)
     setup_path()
-    files = find_tests(module_filter)
+    finder = find_tests(module_filter)
+    files = finder.files
     files.sort()
 
     os.chdir("build")
@@ -354,6 +357,7 @@
             runner(files, test_filter, debug)
     else:
         runner(files, test_filter, debug)
+    print finder.skips, 'tests skipped due to unimportable dependencies'
 
 
 def process_args(argv=None):