Code

fix broken tests by adding additional permissions now that we check for
[roundup.git] / run_tests.py
index 750c29160508286deabcfc26836e804fce105428..5855e8a0c5a7324f24a4fb066630ac134f091e68 100644 (file)
@@ -1,4 +1,4 @@
-#! /usr/bin/env python2.2
+#! /usr/bin/env python
 ##############################################################################
 #
 # Copyright (c) 2001, 2002 Zope Corporation and Contributors.
@@ -184,6 +184,8 @@ class ImmediateTestResult(unittest._TextTestResult):
         self._progressWithNames = 0
         self._count = count
         self._testtimes = {}
+        # docstrings for tests don't override test-descriptions:
+        self.descriptions = False
         if progress and verbosity == 1:
             self.dots = 0
             self._progressWithNames = 1
@@ -446,7 +448,8 @@ def walk_with_symlinks(top, func, arg):
     cycles in your Zope sandbox, so don't do that.
     """
     try:
-        names = os.listdir(top)
+        # Prevent 'hidden' files (those starting with '.') from being considered.
+        names = [f for f in os.listdir(top) if not f.startswith('.')]
     except os.error:
         return
     func(arg, top, names)
@@ -538,7 +541,8 @@ def gui_runner(files, test_filter):
 
     suites = ", ".join(suites)
     minimal = (GUI == "minimal")
-    unittestgui.main(suites, minimal)
+    # unittestgui apparently doesn't take the minimal flag anymore
+    unittestgui.main(suites)
 
 class TrackRefs:
     """Object to track reference counts across test runs."""
@@ -576,7 +580,7 @@ class TrackRefs:
 
 def runner(files, test_filter, debug):
     runner = ImmediateTestRunner(verbosity=VERBOSE, debug=debug,
-                                 progress=progress)
+        progress=progress)
     suite = unittest.TestSuite()
     for file in files:
         s = get_suite(file)
@@ -625,21 +629,20 @@ def main(module_filter, test_filter, libdir):
     global pathinit
     pathinit = PathInit(build, build_inplace, libdir)
 
-# No logging module in py 2.1
-#    # Initialize the logging module.
+    # Initialize the logging module.
 
-#    import logging.config
-#    logging.basicConfig()
+    import logging.config
+    logging.basicConfig()
 
-#    level = os.getenv("LOGGING")
-#    if level:
-#        level = int(level)
-#    else:
-#        level = logging.CRITICAL
-#    logging.root.setLevel(level)
+    level = os.getenv("LOGGING")
+    if level:
+        level = int(level)
+    else:
+        level = logging.CRITICAL
+    logging.root.setLevel(level)
 
-#    if os.path.exists(logini):
-#        logging.config.fileConfig(logini)
+    if os.path.exists(logini):
+        logging.config.fileConfig(logini)
 
     files = find_tests(module_filter)
     files.sort()
@@ -692,7 +695,7 @@ def process_args(argv=None):
 
     module_filter = None
     test_filter = None
-    VERBOSE = 1
+    VERBOSE = 2
     LOOP = 0
     GUI = 0
     TRACE = 0